环境ID:cloud1-8gpy12fx38fa4373
用的是官方代码,改了路径和ID等。用外部浏览器就出现如下错误,在微信中打开已经没有问题。
cloud.callFunction:fail Error: errCode: -504002 functions execute fail | errMsg: Error: errCode: 40165 | errMsg: openapi.urlscheme.generate:fail invalid weapp pagepath rid: 6215ef1c-79920347-7038993b
at callWXOpenAPI (/var/user/node_modules/wx-server-sdk/index.js:2392:31)
at processTicksAndRejections (/internal/process/task_queues.js:97:5) (callId: 1645604635084-0.8861926687145796) (trace: 16:23:55 start->16:23:55 system error (Error: errCode: -504002 functions execute fail | errMsg: Error: errCode: 40165 | errMsg: openapi.urlscheme.generate:fail invalid weapp pagepath rid: 6215ef1c-79920347-7038993b
at callWXOpenAPI (/var/user/node_modules/wx-server-sdk/index.js:2392:31)
at processTicksAndRejections (/internal/process/task_queues.js:97:5)), abort); at cloud.callFunction api;
at new t (cloud.js:16:2910)
at cloud.js:16:3658
at c (cloud.js:16:3711)
at cloud.js:16:190305
t @ cloud.js:16
(anonymous) @ cloud.js:16
c @ cloud.js:16
(anonymous) @ cloud.js:16
看一下生成的代码,报错是因为这个链接中的跳转路径不存在。同时留意一下跳转的版本。微信外部跳转时,设置的版本是生效的(开发、体验、正式版)。