请求所有到云函数都会出现
- 发布:2021-02-13 23:50
- 更新:2021-02-18 10:53
- 阅读:675
产品分类: HbuilderX
PC开发环境操作系统: Mac
PC开发环境操作系统版本号: macos big sur 11.1
HBuilderX版本号: 3.1.2
操作步骤:
预期结果:
{"requestId":"e60a821e-6e12-11eb-ae67-525400e7bfe4","data":{"response_data":"{\"state\":200,\"mgs\":\"成功\",\"data\":[]}
{"requestId":"e60a821e-6e12-11eb-ae67-525400e7bfe4","data":{"response_data":"{\"state\":200,\"mgs\":\"成功\",\"data\":[]}
实际结果:
{"code":"FUNCTIONS_EXECUTE_FAIL","message":"Unexpected token u in JSON at position 0\nSyntaxError: Unexpected token u in JSON at position 0\n at JSON.parse (<anonymous>)\n at exports.main (/var/user/__index.js:6:39)\n at EventHandler.exports.main [as realHandler] (/var/user/index.js:106:21)\n at EventHandler.handle (/var/runtime/node8/bootstrap.js:427:28)\n at invoke (/var/runtime/node8/bootstrap.js:225:22)\n at Timeout.setTimeout [as _onTimeout] (/var/runtime/node8/bootstrap.js:150:9)\n at ontimeout (timers.js:475:11)\n at tryOnTimeout (timers.js:310:5)\n at Timer.listOnTimeout (timers.js:270:5)","requestId":"0ec73c12c4bb1"}
{"code":"FUNCTIONS_EXECUTE_FAIL","message":"Unexpected token u in JSON at position 0\nSyntaxError: Unexpected token u in JSON at position 0\n at JSON.parse (<anonymous>)\n at exports.main (/var/user/__index.js:6:39)\n at EventHandler.exports.main [as realHandler] (/var/user/index.js:106:21)\n at EventHandler.handle (/var/runtime/node8/bootstrap.js:427:28)\n at invoke (/var/runtime/node8/bootstrap.js:225:22)\n at Timeout.setTimeout [as _onTimeout] (/var/runtime/node8/bootstrap.js:150:9)\n at ontimeout (timers.js:475:11)\n at tryOnTimeout (timers.js:310:5)\n at Timer.listOnTimeout (timers.js:270:5)","requestId":"0ec73c12c4bb1"}
bug描述:
请求unicloud 出现{"code":"FUNCTIONS_EXECUTE_FAIL","message":"Unexpected token u in JSON at position 0\nSyntaxError: Unexpected token u in JSON at position 0\n at JSON.parse (<anonymous>)\n at exports.main (/var/user/__index.js:6:39)\n at EventHandler.exports.main [as realHandler] (/var/user/index.js:106:21)\n at EventHandler.handle (/var/runtime/node8/bootstrap.js:427:28)\n at invoke (/var/runtime/node8/bootstrap.js:225:22)\n at Timeout.setTimeout [as _onTimeout] (/var/runtime/node8/bootstrap.js:150:9)\n at ontimeout (timers.js:475:11)\n at tryOnTimeout (timers.js:310:5)\n at Timer.listOnTimeout (timers.js:270:5)","requestId":"0ec73c12c4bb1"}错误,然后我切换到上一个版本就不会出现了,应该是这个新版本的bug
1***@qq.com (作者)
云端,h5,我要怎么上传示例工程呢
2021-03-02 16:23
1***@qq.com (作者)
window HBuilderX 3.1.2也有同样的问题
2021-03-04 10:47
DCloud_uniCloud_WYQ
回复 1***@qq.com: 截图我看一下你的云函数入口文件
2021-03-04 11:00
1***@qq.com (作者)
回复 DCloud_uniCloud_WYQ: 我找到解决到方法了,就是把云函数重新上传一遍就好了,但是切换电脑又得重新上传才不会报错。。。
2021-03-04 22:14
1***@qq.com (作者)
3.0.5的版本就不会出现这样的问题啊
2021-03-04 22:16
DCloud_uniCloud_WYQ
回复 1***@qq.com: 看一下network面板请求云函数对应的请求体,发出来一下
2021-03-08 15:17