云函数调用失败返回结果 {"errorCode":-1,"errorMessage":"Runtime.ImportModuleError: Error: Cannot find module 'utils'\nRequire stack:\n- /var/user/index.js\n- /var/runtime/node12/UserFunction.js\n- /var/runtime/node12/Runtime.engine.js\n- /var/runtime/node12/bootstrap.js\n at Object.module.exports.load (/var/runtime/node12/UserFunction.js:34:13)\n at Runtime.handleOnce (/var/runtime/node12/Runtime.engine.js:99:38)\n at Timeout._onTimeout (/var/runtime/node12/Runtime.engine.js:56:12)\n at listOnTimeout (internal/timers.js:549:17)\n at processTimers (internal/timers.js:492:7)","statusCode":443}
时间: 2023-12-11 15:06:02 浏览: 142
根据给出的错误信息,可以看出云函数调用失败的原因是无法找到名为"utils"的模块。请检查你的代码,看是否正确引入了该模块,并且该模块是否存在于你的项目中。如果没有找到该模块,你需要将该模块添加到你的项目中,或者检查该模块的路径是否正确。如果模块的路径正确,但仍然无法找到该模块,请检查你的代码是否正确地使用了该模块。
相关问题
云函数已经引入模块:const util = require('utils');但调用失败返回结果 {"errorCode":-1,"errorMessage":"Runtime.ImportModuleError: Error: Cannot find module 'utils'\nRequire stack:\n- /var/user/index.js\n- /var/runtime/node12/UserFunction.js\n- /var/runtime/node12/Runtime.engine.js\n- /var/runtime/node12/bootstrap.js\n at Object.module.exports.load (/var/runtime/node12/UserFunction.js:34:13)\n at Runtime.handleOnce (/var/runtime/node12/Runtime.engine.js:99:38)\n at Timeout._onTimeout (/var/runtime/node12/Runtime.engine.js:56:12)\n at listOnTimeout (internal/timers.js:549:17)\n at processTimers (internal/timers.js:492:7)","statusCode":443}
根据错误信息,你的云函数仍然无法找到名为"utils"的模块。请确保该模块的路径和名称正确。你可以尝试使用相对路径或绝对路径来引入该模块,以确保云函数可以正确找到它。另外,你还可以检查一下你的项目结构,看看该模块是否存在于正确的位置。如果这些方法仍然无法解决问题,请尝试重新部署你的云函数,以确保所有依赖项正确安装。
2 400 index.vue:399 QiniuRequestError {name: 'RequestError', message: 'xhr request failed, code: 400 response: {"error":"…field CompleteMultipart.mimeType of type string"}', stack: 'Error\n at QiniuRequestError.QiniuError (webpack…node_modules/qiniu-js/esm/utils/helper.js:248:24)', code: 400, reqId: 'Mm0AAACDvvroC2YX', …} code : 400 data : error : "json: cannot unmarshal array into Go struct field CompleteMultipart.mimeType of type string" [[Prototype]] : Object constructor : ƒ Object() hasOwnProperty : ƒ hasOwnProperty() isPrototypeOf : ƒ isPrototypeOf() propertyIsEnumerable : ƒ propertyIsEnumerable() toLocaleString : ƒ toLocaleString() toString : ƒ toString() valueOf : ƒ valueOf() __defineGetter__ : ƒ __defineGetter__() __defineSetter__ : ƒ __defineSetter__() __lookupGetter__ : ƒ __lookupGetter__() __lookupSetter__ : ƒ __lookupSetter__() __proto__ : (...) get __proto__ : ƒ __proto__() set __proto__ : ƒ __proto__() isRequestError : true message : "xhr request failed, code: 400 response: {\"error\":\"json: cannot unmarshal array into Go struct field CompleteMultipart.mimeType of type string\"}" name : "RequestError" reqId : "Mm0AAACDvvroC2YX" stack : "Error\n at QiniuRequestError.QiniuError (webpack-internal:///./node_modules/qiniu-js/esm/errors/index.js:47:22)\n at new QiniuRequestError (webpack-internal:///./node_modules/qiniu-js/esm/errors/index.js:55:28)\n at xhr.onreadystatechange (webpack-internal:///./node_modules/qiniu-js/esm/utils/helper.js:248:24)" [[Prototype]] : QiniuError constructor : ƒ QiniuRequestError(code, reqId, message, data) [[Prototype]] : Object
这是一个错误信息,看起来是上传文件至七牛云存储时出现了问题,具体错误信息是“json: cannot unmarshal array into Go struct field CompleteMultipart.mimeType of type string”。需要检查代码中的上传参数是否正确,或者联系七牛云存储的支持团队进行帮助。
阅读全文