老师好,检查如下:
1、云函数的日志是空的,但是调试器报错了。如下
WAServiceMainContext.js?t=wechat&s=1668998724865&v=2.27.2:1 Error: cloud.callFunction:fail Error: errCode: -504002 functions execute fail | errMsg: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /var/user/node_modules/axios/index.js
require() of ES modules is not supported.
require() of /var/user/node_modules/axios/index.js from /var/user/index.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename /var/user/node_modules/axios/index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /var/user/node_modules/axios/package.json.
2、云环境ID已经设置,用的自己的环境ID