特殊表情字符substr会导致云函数执行失败
发布于 5 年前 作者 jinming 8855 次浏览 来自 问答
let nickName = '🍒  Tian  Bao';
nickName.substr(01);此代码会导致云函数执行失败,本地调试没问题,上传并部署后会报错
报错信息如下:
VM1208:1 Uncaught (in promise) thirdScriptError
errCode: -404011 cloud function execution error | errMsg: cloud.callFunction:fail requestID , cloud function service error code -504002, error message service unreachable; at cloud.callFunction api; 
Error: errCode: -404011 cloud function execution error | errMsg: cloud.callFunction:fail requestID , cloud function service error code -504002, error message service unreachable; at cloud.callFunction api; 
    at new u (http://127.0.0.1:48745/appservice/__dev__/WAService.js:2:251086)
    at d (http://127.0.0.1:48745/appservice/__dev__/WAService.js:2:251593)
    at f (http://127.0.0.1:48745/appservice/__dev__/WAService.js:2:251688)
    at Function.success (http://127.0.0.1:48745/appservice/__dev__/WAService.js:2:409213)
    at http://127.0.0.1:48745/appservice/__dev__/WAService.js:2:128047
    at E (http://127.0.0.1:48745/appservice/__dev__/WAService.js:2:560837)
    at i. (http://127.0.0.1:48745/appservice/__dev__/WAService.js:2:988999)
    at i.emit (http://127.0.0.1:48745/appservice/__dev__/WAService.js:2:615080)
    at Ii (http://127.0.0.1:48745/appservice/__dev__/WAService.js:2:989861)
    at http://127.0.0.1:48745/appservice/__dev__/WAService.js:2:991140
console.error @ VM1208:1
errorReport @ VM1214 WAService.js:2
thirdErrorReport @ VM1214 WAService.js:2
(anonymous) @ VM1214 WAService.js:2
f @ VM1214 WAService.js:2
i @ VM1214 WAService.js:2
(anonymous) @ VM1214 WAService.js:2
value @ VM1214 WAService.js:2
t @ VM1214 WAService.js:2
(anonymous) @ VM1214 WAService.js:2
2 回复

你好,有定位到是哪一行代码嘛?是这一行对吗,可以尝试编码一下再执行

let nickName = '🍒  Tian  Bao';

用 Array.from(nickName)[0] 呢,会报错不呀

回到顶部