This morning the serverless deployment of my project started to fail. I didn't change anything in the code and the last successful deployment was around a week ago.
Here's the deployment log:
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
I tried to look in my code for the "asyncfunction"
but I could not find any occurrence. The problem seems underneath but I'm not expert enough with this framework to identify it.
I saw the same issue this morning after a big node.js and npm upgrade to get expo and react native working locally on mac.
I ran this:
npm install -g serverless
Which seemed to update to the latest serverless. I now see more warnings about parameter naming but got a successful deploy, hope this helps!
I get this issue when node was updated on our server running Jenkins from 14.16.0 to 14.17.0.
Once node version downgraded to 14.16.0, error message gone.
This may happen when upgrading node to a newer version than the serverless version you are using supports. You can upgrade your serverless version to resolve this.
You can install the very latest version of the package if you know that there have not been any breaking changes between your version and the latest. For example:
npm install --save-dev serverless@latest
You can also specify the latest version of serverless for the "major" version that you're on. Breaking changes should only occur when the "major" version is updated, per semantic versioning, so this is a much safer option
For example, if you previously had some v1.x.y
version of serverless installed, you can install the latest v1
version with:
npm install --save-dev serverless@1
this will allow you to avoid breaking changes
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With