firebase-tools icon indicating copy to clipboard operation
firebase-tools copied to clipboard

firebase serve fails

Open tinkerer opened this issue 8 years ago • 2 comments

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. (C:\Users\Admin\Documents\GitHub\support\functions\index.js:94:38) at Module._compile (module.js:643:30)

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. (C:\Users\Admin\Documents\GitHub\support\functions\index.js:94:38) at Module._compile (module.js:643:30) at Object.Module._extensions..js (module.js:654:10) at Module.load (module.js:556:32) at tryModuleLoad (module.js:499:12) at Function.Module._load (module.js:491:3) at Module.require (module.js:587:17) at require (internal/module.js:11:18) at C:\Users\Admin\AppData\Roaming\npm\node_modules\firebase-tools\lib\triggerParser.js:21:11 at Object. (C:\Users\Admin\AppData\Roaming\npm\node_modules\firebase-tools\lib\triggerParser.js:61:3) at Module._compile (module.js:643:30) at Object.Module._extensions..js (module.js:654:10) at Module.load (module.js:556:32) at tryModuleLoad (module.js:499:12) at Function.Module._load (module.js:491:3) at Function.Module.runMain (module.js:684:10) at startup (bootstrap_node.js:187:16) at bootstrap_node.js:608:3 ! functions: Error from emulator. Error occurred while parsing your function triggers.

TypeError: Cannot read property 'id' of undefined at Object. (C:\Users\Admin\Documents\GitHub\support\functions\index.js:94:38) at Module._compile (module.js:643:30) at Object.Module._extensions..js (module.js:654:10) at Module.load (module.js:556:32) at tryModuleLoad (module.js:499:12) at Function.Module._load (module.js:491:3) at Module.require (module.js:587:17) at require (internal/module.js:11:18) at C:\Users\Admin\AppData\Roaming\npm\node_modules\firebase-tools\lib\triggerParser.js:21:11 at Object. (C:\Users\Admin\AppData\Roaming\npm\node_modules\firebase-tools\lib\triggerParser.js:61:3) at Module._compile (module.js:643:30) at Object.Module._extensions..js (module.js:654:10) at Module.load (module.js:556:32) at tryModuleLoad (module.js:499:12) at Function.Module._load (module.js:491:3) at Function.Module.runMain (module.js:684:10) at startup (bootstrap_node.js:187:16) at bootstrap_node.js:608:3 [2018-04-16T21:36:53.095Z]

tinkerer avatar Apr 16 '18 21:04 tinkerer

Error is from line 94 of functions/index.js, please share that line and any relevant surrounding code snippets.

laurenzlong avatar Apr 17 '18 18:04 laurenzlong

Closing due to no response, I'll reopen it once there's more info.

laurenzlong avatar Jun 05 '18 18:06 laurenzlong