今天上午,我的项目的无服务器部署开始失败。我没有更改代码中的任何内容,最后一次成功部署是在大约一周前。
下面是部署日志:
Error --------------------------------------------------
Error: Unknown object type "asyncfunction"
at Object._object (/usr/local/lib/node_modules/serverless/node_modules/object-hash/index.js:218:17)
at Object._function (/usr/local/lib/node_modules/serverless/node_modules/object-hash/index.js:319:14)
at Object.dispatch (/usr/local/lib/node_modules/serverless/node_modules/object-hash/index.js:185:30)
at /usr/local/lib/node_modules/serverless/node_modules/object-hash/index.js:246:18
at Array.forEach (<anonymous>)
at Object._object (/usr/local/lib/node_modules/serverless/node_modules/object-hash/index.js:242:21)
at Object._function (/usr/local/lib/node_modules/serverless/node_modules/object-hash/index.js:319:14)
at Object.dispatch (/usr/local/lib/node_modules/serverless/node_modules/object-hash/index.js:185:30)
at /usr/local/lib/node_modules/serverless/node_modules/object-hash/index.js:246:18
at Array.forEach (<anonymous>)
at Object._object (/usr/local/lib/node_modules/serverless/node_modules/object-hash/index.js:242:21)
at Object.dispatch (/usr/local/lib/node_modules/serverless/node_modules/object-hash/index.js:185:30)
at /usr/local/lib/node_modules/serverless/node_modules/object-hash/index.js:246:18
at Array.forEach (<anonymous>)
at Object._object (/usr/local/lib/node_modules/serverless/node_modules/object-hash/index.js:242:21)
at Object.dispatch (/usr/local/lib/node_modules/serverless/node_modules/object-hash/index.js:185:30)
at /usr/local/lib/node_modules/serverless/node_modules/object-hash/index.js:246:18
at Array.forEach (<anonymous>)
at Object._object (/usr/local/lib/node_modules/serverless/node_modules/object-hash/index.js:242:21)
at Object.dispatch (/usr/local/lib/node_modules/serverless/node_modules/object-hash/index.js:185:30)
at /usr/local/lib/node_modules/serverless/node_modules/object-hash/index.js:246:18
at Array.forEach (<anonymous>)
at Object._object (/usr/local/lib/node_modules/serverless/node_modules/object-hash/index.js:242:21)
at Object.dispatch (/usr/local/lib/node_modules/serverless/node_modules/object-hash/index.js:185:30)
at /usr/local/lib/node_modules/serverless/node_modules/object-hash/index.js:246:18
at Array.forEach (<anonymous>)
at Object._object (/usr/local/lib/node_modules/serverless/node_modules/object-hash/index.js:242:21)
at Object.dispatch (/usr/local/lib/node_modules/serverless/node_modules/object-hash/index.js:185:30)
at /usr/local/lib/node_modules/serverless/node_modules/object-hash/index.js:246:18
at Array.forEach (<anonymous>)
at Object._object (/usr/local/lib/node_modules/serverless/node_modules/object-hash/index.js:242:21)
at Object.dispatch (/usr/local/lib/node_modules/serverless/node_modules/object-hash/index.js:185:30)
at /usr/local/lib/node_modules/serverless/node_modules/object-hash/index.js:246:18
at Array.forEach (<anonymous>)
at Object._object (/usr/local/lib/node_modules/serverless/node_modules/object-hash/index.js:242:21)
at Object.dispatch (/usr/local/lib/node_modules/serverless/node_modules/object-hash/index.js:185:30)
at hash (/usr/local/lib/node_modules/serverless/node_modules/object-hash/index.js:128:10)
at objectHash (/usr/local/lib/node_modules/serverless/node_modules/object-hash/index.js:33:10)
at Function.exports.sha1 (/usr/local/lib/node_modules/serverless/node_modules/object-hash/index.js:44:10)
at AwsProvider.request (/usr/local/lib/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:234:35)
at AwsDeploy.uploadZipFile (/usr/local/lib/node_modules/serverless/lib/plugins/aws/deploy/lib/uploadArtifacts.js:76:26)
at BbPromise.map.concurrency (/usr/local/lib/node_modules/serverless/lib/plugins/aws/deploy/lib/uploadArtifacts.js:127:21)
at tryCatcher (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/util.js:16:23)
at MappingPromiseArray._promiseFulfilled (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/map.js:68:38)
at MappingPromiseArray.PromiseArray._iterate (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/promise_array.js:115:31)
at MappingPromiseArray.init (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/promise_array.js:79:10)
at MappingPromiseArray._asyncInit (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/map.js:37:10)
at _drainQueueStep (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:97:12)
at _drainQueue (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:86:9)
at Async._drainQueues (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:102:5)
at Immediate.Async.drainQueues [as _onImmediate] (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:15:14)
at processImmediate (node:internal/timers:463:21)
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Issues: forum.serverless.com
Your Environment Information ---------------------------
Operating System: darwin
Node Version: 15.4.0
Framework Version: 1.63.0
Plugin Version: 3.3.0
SDK Version: 2.3.0
Components Core Version: 1.1.2
Components CLI Version: 1.4.0我试图查找我的代码中的"asyncfunction",但我找不到任何发生。问题似乎隐藏在下面,但我对这个框架不够精通,无法识别它。
发布于 2020-12-14 01:16:46
今天早上,我看到了同样的问题,在对node.js和npm进行了一次大的升级之后,我看到了在mac上本地工作的展会和反应。
我查过这个:
npm install -g serverless似乎更新到了最新的无服务器状态。现在我看到了更多关于参数命名的警告,但是部署成功了,希望这会有所帮助!
发布于 2021-05-20 16:09:44
当运行Jenkins的服务器上的节点从14.16.0更新到14.17.0时,我就会遇到这个问题。
一旦节点版本降级到14.16.0,错误消息就消失了。
发布于 2021-05-26 14:06:18
当将节点升级到比使用支持的无服务器版本更新的版本时,可能会发生这种情况。您可以升级您的无服务器版本以解决此问题。
如果您知道您的版本和最新版本之间没有任何中断更改,则可以安装该软件包的最新版本。例如:
npm install --save-dev serverless@latest您还可以为您所使用的“主要”版本指定最新的无服务器版本。只有当“主要”版本按语义版本化更新时才会发生破坏更改,因此这是一个更安全的选项。
例如,如果以前安装了一些v1.x.y版本的无服务器服务器,则可以使用以下方式安装最新的v1版本:
npm install --save-dev serverless@1这将使您避免破坏更改。
https://stackoverflow.com/questions/65276144
复制相似问题