You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 15, 2019. It is now read-only.
Promises are not handled as expected by the cloud-functions emulator. For example, all functions from the nodejs-docs-samples/functions/datastore test suite that rely on promises return the following error:
{
"stack": "TypeError: Cannot read property 'then' of undefined\n at Object.set (/Users/kasper/Development/google-app-engine/server/modules/datastore/functions.js:69:5)\n at Object.invoke (/usr/local/lib/node_modules/@google-cloud/functions-emulator/src/emulator/invoker.js:38:15)\n at Object._invoke (/usr/local/lib/node_modules/@google-cloud/functions-emulator/src/emulator/index.js:439:19)\n at /usr/local/lib/node_modules/@google-cloud/functions-emulator/src/emulator/index.js:383:14\n at Layer.handle [as handle_request] (/usr/local/lib/node_modules/@google-cloud/functions-emulator/node_modules/express/lib/router/layer.js:95:5)\n at next (/usr/local/lib/node_modules/@google-cloud/functions-emulator/node_modules/express/lib/router/route.js:131:13)\n at next (/usr/local/lib/node_modules/@google-cloud/functions-emulator/node_modules/express/lib/router/route.js:125:14)\n at next (/usr/local/lib/node_modules/@google-cloud/functions-emulator/node_modules/express/lib/router/route.js:125:14)\n at next (/usr/local/lib/node_modules/@google-cloud/functions-emulator/node_modules/express/lib/router/route.js:125:14)\n at next (/usr/local/lib/node_modules/@google-cloud/functions-emulator/node_modules/express/lib/router/route.js:125:14)",
"message": "Cannot read property 'then' of undefined"
}
Yes I am using 0.4.0. However, I was perhaps a little too trigger happy when opening this issue and after a bit of digging it seems the problem is with the porting of GoogleCloudPlatform/nodejs-docs-samples repo. I have opened a new issue at GoogleCloudPlatform/nodejs-docs-samples#284.
Description
Promises are not handled as expected by the cloud-functions emulator. For example, all functions from the nodejs-docs-samples/functions/datastore test suite that rely on promises return the following error:
Steps to reproduce
http://localhost:8008/set
(I used Postman)Looking forward to using this wonderful tool!
The text was updated successfully, but these errors were encountered: