C/C++教程

TypeError: Cannot read property 'userAgent' of undefined at Timeout.task [as _onTimeout

本文主要是介绍TypeError: Cannot read property 'userAgent' of undefined at Timeout.task [as _onTimeout,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
Error: Uncaught [TypeError: Cannot read property 'userAgent' of undefined]
    at reportException (D:\cnipa\node_modules\jsdom\lib\jsdom\living\helpers\runtime-script-errors.js:66:24)
    at Timeout.task [as _onTimeout] (D:\cnipa\node_modules\jsdom\lib\jsdom\browser\Window.js:521:9)
    at listOnTimeout (internal/timers.js:555:17)
    at processTimers (internal/timers.js:498:7) TypeError: Cannot read property 'userAgent' of undefined
    at _$VJ (eval at _$LN (http://epub.cnipa.gov.cn/gjcx.jsp:1:9116), <anonymous>:1:227500)
    at _$VJ (eval at _$LN (http://epub.cnipa.gov.cn/gjcx.jsp:1:9116), <anonymous>:1:250202)
    at _$VJ (eval at _$LN (http://epub.cnipa.gov.cn/gjcx.jsp:1:9116), <anonymous>:1:224959)
    at _$VJ (eval at _$LN (http://epub.cnipa.gov.cn/gjcx.jsp:1:9116), <anonymous>:1:248477)
    at _$XT (eval at _$LN (http://epub.cnipa.gov.cn/gjcx.jsp:1:9116), <anonymous>:1:262111)
    at _$jM (eval at _$LN (http://epub.cnipa.gov.cn/gjcx.jsp:1:9116), <anonymous>:1:207195)
    at Timeout.task [as _onTimeout] (D:\cnipa\node_modules\jsdom\lib\jsdom\browser\Window.js:516:19)
    at listOnTimeout (internal/timers.js:555:17)
    at processTimers (internal/timers.js:498:7)

 

大牛看了一下,说是jsdom代码报错,既然是代码报错,那就把这块代码注视掉吧,不让它报错了,省得去恶心人啊

    找到 D:\cnipa\node_modules\jsdom\lib\jsdom\browser\Window.js,打开Window.js代码,找到516行,直接注视掉就可以了

    把 handler.apply(methodContextProxy, args); 注释掉就可以了,如下图

    

 

这篇关于TypeError: Cannot read property 'userAgent' of undefined at Timeout.task [as _onTimeout的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!