firebase serve fails
Version info
firebase-tools: 3.18.4 firebase-admin 5.12.0 firebase-functions: 1.0.1
Platform Information
Windows
Steps to reproduce
running the latest version of everything when I call: firebase serve
I see " Failed to load functions source code. Ensure that you have the latest SDK by running npm i --save firebase-functions inside the functions directory."
and also an error is printed related to firebase.config(): Error during trigger parsing: Error occurred while parsing your function triggers.
TypeError: Cannot read property 'id' of undefined
at Object.
These errors appeared after upgrading and migrating my code for the 1.0 release of cloud functions.
Expected behavior
I see no errors if i downgrade: npm install -g [email protected]
C:\Users\Admin\Documents\GitHub\support> firebase serve
=== Serving from 'C:\Users\Admin\Documents\GitHub\support'...
i hosting: Serving hosting files from: public2
- hosting: Local server: http://localhost:5000
Actual behavior
PS C:\Users\Admin\Documents\GitHub\support> firebase serve --debug [2018-04-16T21:36:47.603Z] ---------------------------------------------------------------------- [2018-04-16T21:36:47.609Z] Command: C:\Program Files\nodejs\node.exe C:\Users\Admin\AppData\Roaming\npm\node_modules\firebase-tools\bin\firebase serve --debug [2018-04-16T21:36:47.610Z] CLI Version: 3.18.4 [2018-04-16T21:36:47.610Z] Platform: win32 [2018-04-16T21:36:47.611Z] Node Version: v8.9.4 [2018-04-16T21:36:47.612Z] Time: Mon Apr 16 2018 14:36:47 GMT-0700 (Pacific Daylight Time) [2018-04-16T21:36:47.612Z] ----------------------------------------------------------------------
[2018-04-16T21:36:47.625Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","http s://www.googleapis.com/auth/cloud-platform"] [2018-04-16T21:36:47.626Z] > authorizing via signed-in user [2018-04-16T21:36:47.629Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/projects/project-2806028839033222574
Mon Apr 16 2018 14:36:47 GMT-0700 (Pacific Daylight Time) [2018-04-16T21:36:48.051Z] <<< HTTP RESPONSE 200 server=nginx, date=Mon, 16 Apr 2018 21:36:49 GMT, content-type=application/json; charset=utf-8, content-length=96, connection=close, x-c ontent-type-options=nosniff, strict-transport-security=max-age=31536000; includeSubdomains, cache-control=no-cache, no-store [2018-04-16T21:36:48.057Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/database/[companyname]/tokens
Mon Apr 16 2018 14:36:48 GMT-0700 (Pacific Daylight Time) [2018-04-16T21:36:48.485Z] <<< HTTP RESPONSE 200 server=nginx, date=Mon, 16 Apr 2018 21:36:50 GMT, content-type=application/json; charset=utf-8, content-length=254, connection=close, x- content-type-options=nosniff, strict-transport-security=max-age=31536000; includeSubdomains, cache-control=no-cache, no-store [2018-04-16T21:36:48.490Z] >>> HTTP REQUEST GET https://cloudresourcemanager.googleapis.com/v1/projects/project-2806028839033222574
Mon Apr 16 2018 14:36:48 GMT-0700 (Pacific Daylight Time) [2018-04-16T21:36:48.852Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Mon, 16 Apr 2018 21:36:50 GMT, server =ESF, cache-control=private, x-xss-protection=1; mode=block, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=hq=":443"; ma=2592000; quic=51303432; quic=51303431; qui c=51303339; quic=51303335,quic=":443"; ma=2592000; v="42,41,39,35", accept-ranges=none, connection=close
=== Serving from 'C:\Users\Admin\Documents\GitHub\support'...
i functions: Preparing to emulate functions. [2018-04-16T21:36:49.602Z] Fetching environment [2018-04-16T21:36:49.606Z] >>> HTTP REQUEST GET https://mobilesdk-pa.googleapis.com/v1/projects/821002039994:getServerAppConfig
Mon Apr 16 2018 14:36:49 GMT-0700 (Pacific Daylight Time) [2018-04-16T21:36:49.608Z] >>> HTTP REQUEST GET https://mobilesdk-pa.googleapis.com/v1/projects/821002039994/clients/_:getWebAppConfig
Mon Apr 16 2018 14:36:49 GMT-0700 (Pacific Daylight Time) [2018-04-16T21:36:50.017Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Mon, 16 Apr 2018 21:36:51 GMT, server =ESF, cache-control=private, x-xss-protection=1; mode=block, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=hq=":443"; ma=2592000; quic=51303432; quic=51303431; qui c=51303339; quic=51303335,quic=":443"; ma=2592000; v="42,41,39,35", accept-ranges=none, connection=close i hosting: Serving hosting files from: public2
- hosting: Local server: http://localhost:5000
[2018-04-16T21:36:50.088Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Mon, 16 Apr 2018 21:36:51 GMT, server =ESF, cache-control=private, x-xss-protection=1; mode=block, x-frame-options=SAMEORIGIN, x-content-type-options=nosniff, alt-svc=hq=":443"; ma=2592000; quic=51303432; quic=51303431; qui c=51303339; quic=51303335,quic=":443"; ma=2592000; v="42,41,39,35", accept-ranges=none, connection=close [2018-04-16T21:36:50.091Z] Starting @google-cloud/functions-emulator Warning: You're using Node.js v8.9.4 but Google Cloud Functions only supports v6.11.5. [2018-04-16T21:36:52.121Z] Parsing function triggers ! functions: Failed to load functions source code. Ensure that you have the latest SDK by running npm i --save firebase-functions inside the functions directory. [2018-04-16T21:36:53.093Z] Error during trigger parsing: Error occurred while parsing your function triggers.
TypeError: Cannot read property 'id' of undefined
at Object.
TypeError: Cannot read property 'id' of undefined
at Object.
Error is from line 94 of functions/index.js, please share that line and any relevant surrounding code snippets.
Closing due to no response, I'll reopen it once there's more info.