2.0.10 http请求 模拟器崩溃

  • Creator 版本:2.0.10

  • 目标平台: 模拟器

  • 详细报错信息,包含调用堆栈:2019-12-13T07:15:10.629Z - normal: Simulator: D/jswrapper (129): JS: Cocos Creator v2.0.10

2019-12-13T07:15:10.811Z - normal: Simulator: D/jswrapper (1108): XMLHttpRequest.withCredentials isn’t implemented on JSB!
2019-12-13T07:15:10.811Z - normal: Simulator: In the constructor of HttpClient!

2019-12-13T07:15:10.813Z - error: Simulator: E/jswrapper (271): ERROR: Uncaught TypeError: Cannot set property ‘onprogress’ of undefined, location: assets/Script/common/http.js:0:0
STACK:
[0]sendobj@assets/Script/common/http.js:21
[1]onLoad@assets/Script/mainScene/loading.js:248
[2]anonymous@(no filename):3
[3]invoke@src/cocos2d-jsb.js:12103
[4]activateNode@src/cocos2d-jsb.js:23153
[5]_activate@src/cocos2d-jsb.js:9230
[6]runSceneImmediate@src/cocos2d-jsb.js:7154
[7]anonymous@main.js:53
[8]anonymous@src/cocos2d-jsb.js:25816
[9]anonymous@src/cocos2d-jsb.js:21083
[10]anonymous@src/cocos2d-jsb.js:30422
[11]fireTimeout@jsb-adapter/jsb-builtin.js:2033
[12]tick@jsb-adapter/jsb-builtin.js:1995
at HTMLElement.print-simulator-log (D:\CocosCreator_2.0.10\resources\app.asar\editor\builtin\scene\panel\messages\scene.js:1:1501)
at Object.e._dispatch (D:\CocosCreator_2.0.10\resources\app.asar\editor-framework\lib\renderer\panel.js:1:1941)
at EventEmitter.o.on.s (D:\CocosCreator_2.0.10\resources\app.asar\editor-framework\lib\renderer\ipc.js:1:2921)
at emitMany (events.js:127:13)
at EventEmitter.emit (events.js:204:7)
2019-12-13T07:15:10.814Z - error: Simulator: E/jswrapper (534): [ERROR] (…\cocos\scripting\js-bindings\jswrapper\v8\Object.cpp, 534): Invoking function (094FC190) failed!
at HTMLElement.print-simulator-log (D:\CocosCreator_2.0.10\resources\app.asar\editor\builtin\scene\panel\messages\scene.js:1:1501)
at Object.e._dispatch (D:\CocosCreator_2.0.10\resources\app.asar\editor-framework\lib\renderer\panel.js:1:1941)
at EventEmitter.o.on.s (D:\CocosCreator_2.0.10\resources\app.asar\editor-framework\lib\renderer\ipc.js:1:2921)
at emitMany (events.js:127:13)
at EventEmitter.emit (events.js:204:7)

  • 出现概率:必现

demo.zip (599.5 KB)

临时方案 xhr.onprogress 注释掉 改用onreadystatechange

虽然临时解决了 还是希望大佬们帮忙看看是什么问题 为什么 onprogress 就报错了

原生平台目前并没有实现这个接口,请知悉~