收藏
回答

特殊表情字符substr会导致云函数执行失败

框架类型 问题类型 终端类型 AppID 环境ID 基础库版本
小程序 Bug 微信安卓客户端 wxb53ba1bee1a3319a prod-env-cqt7c 2.11.0
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
最后一次编辑于  2020-06-28
回答关注问题邀请回答
收藏

2 个回答

  • 哄哄
    哄哄
    2020-06-28

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

    let nickName = '🍒  Tian  Bao';
    


    2020-06-28
    有用 1
    回复 1
    • 奥利给
      奥利给
      2020-06-28
      应该是emoji编码的问题,只是本地执行没问题,有点奇怪而已
      2020-06-28
      回复
  • 卢霄霄
    卢霄霄
    2020-06-28

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

    2020-06-28
    有用
    回复
登录 后发表内容
问题标签