-
Notifications
You must be signed in to change notification settings - Fork 114
Function example crashes emulator #323
Description
The function emulator seems to crash on the firebase nextjs-with-firebase-hosting function example. Strange thing is that when run with inspect it does not seems to crash. The crash is cuases by the "await app.prepare()" from next dependency.
$ functions start
Google Cloud Functions Emulator RUNNING
┌────────┬──────┬─────────┬──────────────────────────────────────────────────────────┐
│ Status │ Name │ Trigger │ Resource │
├────────┼──────┼─────────┼──────────────────────────────────────────────────────────┤
│ READY │ next │ HTTP │ http://localhost:5000/test-next/us-central1/next │
└────────┴──────┴─────────┴──────────────────────────────────────────────────────────┘
$ functions call next
ExecutionId: fe286d3b-3cc4-455b-bf47-ccb51bcf4420
Error: { error:
{ code: 500,
status: 'INTERNAL',
message: 'function crashed',
errors: [ 'socket hang up' ] } }
$ functions inspect next
Debugger for next listening on port 9229.
$ functions call next
ExecutionId: 964c6366-ec00-4e07-a87e-f51441e08f17
Error: Not Implemented
$ functions logs read
2019-04-20T09:39:58.902Z - error: Function worker killed by signal: SIGTERM
2019-04-20T09:55:03.706Z - error: Warning, estimating Firebase Config based on GCLOUD_PROJECT. Initializing firebase-admin may fail
2019-04-20T09:55:03.707Z - info: DEV true
2019-04-20T09:55:04.337Z - info: User function triggered, starting execution
2019-04-20T09:55:04.337Z - info: File: /
2019-04-20T09:55:04.348Z - info: Execution took 837 ms, finished with status: 'crash'
2019-04-20T09:55:04.358Z - error: Function worker killed by signal: SIGTERM
2019-04-20T09:55:19.288Z - error: Debugger listening on ws://127.0.0.1:9229/e66d0a61-7209-41ba-aafa-edfde33bf0ca
For help see https://nodejs.org/en/docs/inspector
2019-04-20T09:55:19.448Z - error: Warning, estimating Firebase Config based on GCLOUD_PROJECT. Initializing firebase-admin may fail
2019-04-20T09:55:19.449Z - info: DEV true
2019-04-20T09:55:19.895Z - info: Debugger (via --inspect) for projects/test-next/locations/us-central1/functions/next listening on port 9229.
2019-04-20T09:55:23.684Z - info: User function triggered, starting execution
2019-04-20T09:55:23.684Z - info: File: /
2019-04-20T09:55:25.131Z - info: Execution took 1448 ms, user function completed successfully
Environment details
- OS: MacOs 10.14
- Node.js version: v8.15.1
- npm version: 6.4.1
- @google-cloud/functions-emulator version: 1.0.0-beta.6
Steps to reproduce
- install functions: git clone [email protected]:firebase/functions-samples.git
- move to example folder: cd functions-samples/nextjs-with-firebase-hosting
- update next@beta dependisy in function and app folder package.json to a valid version. beta does not seem to exist anymore. Changed it to "next": "^8.1.0"
- yarn install in root folder
5 functions start && functions call next
Thanks!
Mark