Comments (66)
is this resolved? still getting the same problem
from firebase-functions.
Hey everyone, we are working on a new Node 8 runtime and will support it soon. You will have the option to pick between Node 6 and Node 8 and won't be forced to upgrade.
from firebase-functions.
Hey everyone, Node 8 is now available with the latest SDK and CLI, learn more at https://firebase.google.com/docs/functions/manage-functions#set_nodejs_version
from firebase-functions.
A note for anyone here using TypeScript like I was: you need to run npm run build
in the functions directory before running serve.
from firebase-functions.
Same error, and my node is v6.11.
from firebase-functions.
on nvm 6.11.1
npm uninstall -g firebase-tools
npm install -g firebase-tools
nvm use 6.11.5
Finally resolved it for me
from firebase-functions.
@jasenkoh @tysonnero Does the problem go away if you update to 6.11.1?
from firebase-functions.
Thanks for the update! Error messaging fixed here firebase/firebase-tools#490
from firebase-functions.
Are you using nvm? If so, use the following:
nvm install 6.11.5
and then give it a try. Hope that helps!
from firebase-functions.
After trying just about everything, ps ax | grep firebase
, kill -9 xxxx
all existing firebase processes and running firebase serve
again did the trick.
from firebase-functions.
Great !
Please also consider :
- Node 10.5 with workers
- QUIC, which is available on GCP
- Brotli, as requested by Googlers @addyosmani and @DasSurma
from firebase-functions.
@DenisCangemi @aliparr- Were you able to deploy these functions successfully?
from firebase-functions.
I updated my node version to v8.6.0 and all of my problems were gone.
from firebase-functions.
@aliparr- I did get this message too but I get only a warning now: Warning: You're using Node.js v8.6.0 but Google Cloud Functions only supports v6.11.1.
Other version numbers at me:
npm: 5.3.0
firebase-tools: 3.12.0
firebase-admin 5.2.1
firebase-functions 0.6.3
Here's what I did:
functions stop
npm uninstall -g @google-cloud/functions-emulator
rm ~/.config/configstore/@google-cloud/functions-emulator
npm uninstall -g firebase-tools
npm cache clean -f
rm -rf functions/node_modules
npm i -g firebase-tools
npm i -g @google-cloud/functions-emulator
cd functions
npm i
Hope this helps.
from firebase-functions.
Yep, I discovered that my code had issues, but that the error wasn't being displayed. I had to add a console.log inside of parseTriggers to see the actual error text. Perhaps we could just ensure that gets to the screen for the developer?
from firebase-functions.
@Kar1Huang Can you file that as an issue on https://github.com/GoogleCloudPlatform/cloud-functions-emulator?
from firebase-functions.
Not needed, as this hotfix works:
firebase/firebase-tools#770 (comment)
from firebase-functions.
Is Firebase going to upgrade to Node v8.11.1 ??
from firebase-functions.
@LaZeR30 The NodeJS team has a Release
repo where you can review the planned lifespan of each LTS release.
Right now, v6.x.x has a sunset date of April 2019.
Because Firebase Functions needs to continue to support a wide-array of customers that rely on certain versions of node, upgrading is a much more in-depth process that involves active involvement from every single user of Firebase Functions in order to ensure production instances of presently deployed applications aren't affected in the long term from changing LTS version. Although Node v8.x.x has moved into LTS, it won't officially take over until April 2019, at which point the NodeJS team cannot ensure v6.x.x.
My assumption would be that early next year we'll start seeing emails from Google about a forced upgrade from v6.x.x to v8.x.x Correction: @laurenzlong Mentioned below that a new Node 8 runtime will be supported soon, and there will be no forced upgrade.
If you're having trouble with it on your local machine, I use the n
NPM package to switch between versions quickly when I'm developing among multiple applications that rely on varying node engines.
Check it out: https://npmjs.com/package/n
from firebase-functions.
@prakis I would recommend using n
(or, alternatively, nvm
) when developing with firebase-functions, making sure to using v6.11.x — This is what I've done to get around other issues. Using a transpiler like Babel can help polyfill/transpile features that don't exist in v6.11.x that you may need to leverage.
When developing a firebase-functions
application:
$ n 6.11.5
$ node -v
v6.11.5
Other usage examples:
$ n lts
$ node -v
v8.11.3
$ n latest
$ node -v
v10.7.0
It's an extra step, but a solution nonetheless, one that I use without issues.
from firebase-functions.
I still have same issue. Changing to node 6.11.5 had no effect, same issue.
Firebase worked great for my other project. Now I am not even able to start a new firebase project on Windows.
from firebase-functions.
For those that this may help, running firebase serve
at the same time as firebase functions:shell
will result in these errors.
Thanks to @isabellachen.
from firebase-functions.
As the error message says, you need v6.11.x or higher to run the emulator.
from firebase-functions.
Same here
from firebase-functions.
@robsonataide @jasenkoh what are your exact node versions?
from firebase-functions.
@laurenzlong 6.11
from firebase-functions.
Can you give me the patch version as well? (ie what gets printed when you run node --version
)
from firebase-functions.
@laurenzlong v6.11.0
from firebase-functions.
@jasenkoh Same issue
from firebase-functions.
We have a dependency on the Google Cloud Functions emulator, and 6.11.1 is the minimum engine requirement: https://github.com/GoogleCloudPlatform/cloud-functions-emulator/blob/master/package.json#L8
from firebase-functions.
@laurenzlong worked for me, thanks
from firebase-functions.
I'm suffering from the same issue:
node [email protected]
[email protected]
[email protected]
[email protected]
Then:
firebase serve --only functions
i functions: Preparing to emulate functions.
⚠ 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.
⚠ functions: Error from emulator. Error
at Error.FirebaseError (/usr/local/lib/node_modules/firebase-tools/lib/error.js:11:17)
at ChildProcess. (/usr/local/lib/node_modules/firebase-tools/lib/parseTriggers.js:24:16)
@laurenzlong - You're my only hope!
from firebase-functions.
@aliparr- Same issue
from firebase-functions.
@laurenzlong yes, deploy works correctly
from firebase-functions.
@laurenzlong +1 - deploy works fine for me too.
from firebase-functions.
I am facing the same issue, Funny thing is if I skip initializing firebase admin it executes just fine.
node 6.11.1
firebase-admin 5.2.1
firebase-functions 0.6.2
Update: I checked my code and found out that the issue had to do with some other module i was importing.
from firebase-functions.
@dhargitai Really? If I do that I get:
"⚠ functions: Cannot start emulator. Please use Node version v6.9.1, you have v8.6.0"
from firebase-functions.
Having the same issue, but using NVM. Ran @dhargitai instructions on both 8.6.0 and 6.11.1 with the same result. Checked for any globals residing in /usr/local/lib/node_modules that shouldn't be there, but just npm as it should be. npm correctly installs firebase-functions 0.7.0 in functions/node_modules. firebase-tools is 3.13.0.
from firebase-functions.
This has been happening to me every time my code breaks. And every time it gets solved after I debug.
from firebase-functions.
@Nipperstick I just checked it with updated versions and everything works correctly at me.
Version numbers:
- nvm: 0.33.4
- firebase-tools: 3.13.0
- firebase-admin: 5.4.1
- firebase-functions: 0.7.0
from firebase-functions.
I suffered from similar problem too. My IDE inserted the import of the firebase-admin package incorrectly (as relative module path), and I got
"⚠ 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."
message constantly. Not too developer-friendly error.
from firebase-functions.
@laurenzlong Same issue:
[email protected]
[email protected]
[email protected]
node@8.*
run firebase serve --only functions
output:
i functions: Preparing to emulate functions.
Warning: You're using Node.js v8.1.3 but Google Cloud Functions only supports v6.11.5.
⚠ functions: Failed to emulate helloWorld
while if i switch to node@6.*
⚠ functions: Cannot start emulator. Error: Cannot find module '/usr/local/lib/node_modules/firebase-tools/node_modules/grpc/src/node/extension_binary/node-v48-darwin-x64-unknown/grpc_node.node'
when i go to /usr/local/lib/node_modules/firebase-tools/node_modules/grpc/src/node/extension_binary
i only got node-v57-darwin-x64-unknown
instead of node-v48-darwin-x64-unknown
from firebase-functions.
@laurenzlong sure created googlearchive/cloud-functions-emulator#173
from firebase-functions.
It worked with following:
npm install -g firebase-tools
nvm install 6.11.5
from firebase-functions.
doenst work for me :(
i functions: Preparing to emulate functions.
Warning: You're using Node.js v8.6.0 but Google Cloud Functions only supports v6.11.5.
⚠ functions: Failed to emulate getWeather
from firebase-functions.
Using with 6.11.5
, It works.
from firebase-functions.
@Kar1Huang
When you switch from one version of node to a other one you need to re-install firebase-tools
that's why you don't have the correct folder
from firebase-functions.
thanks guys, but still doesnt work for me
⚠ functions: Failed to emulate getWeather
from firebase-functions.
why this issue has been closed? I reckon issue is still valid for many devs:
[warn] ! functions: Failed to emulate hello
node v6.11.5
firebase-tools 3.16.0
"firebase-admin": "^5.5.0",
"firebase-functions": "^0.7.5"
from firebase-functions.
@ googlearchive/cloud-functions-emulator#173
from firebase-functions.
@Kar1Huang @flado It's unclear that you're facing the same issue as the original issue here. Could you please ensure that you have the latest firebase-tools by running npm install -g firebase-tools
. And file any new issues to the firebase-tools repo instead of this one, and follow the issues template completely so all the debug logs are captured.
from firebase-functions.
I updated my node version to 8.4.0 and it worked fine, despite cloud functions not "supporting" 8.4.0
Edit: with a version manager like nvm or n it's no biggy switching between versions
from firebase-functions.
nothing helps...
node v6.11.5 (npm v5.6.0)
[email protected]
[email protected]
[email protected]
this is the last lines of firebase-debug.log
[debug] [2018-01-30T00:34:31.550Z] Starting @google-cloud/functions-emulator
[debug] [2018-01-30T00:34:32.822Z] Parsing function triggers
firebase serve --only function
gets me that far and then it hangs up. in the terminal it just stops at i functions: Preparing to emulate functions.
What to do? What to do? Help please.
from firebase-functions.
Same here like @ohabash
brew unlink
brew switch node@6 6.11.1_1
brew link node@6 --force
other steps for uninstall and install dependencies
node v6.11.1_1
npm 5.6.0
firebase-admin 5.8.2
firebase-functions 0.8.1
firebase-tools 3.17.4
firebase serve --only functions,hosting
then i functions: Preparing to emulate functions.
is the last message for functions. If I trigger something, only deployed one runs and nothing on local side.
firebase-debug.log
says (head)
[debug] [2018-02-13T01:11:08.276Z] -------------------------------------------------------------------
---
[debug] [2018-02-13T01:11:08.278Z] Command: /usr/local/Cellar/node@6/6.11.1_1/bin/node /usr/loca
l/bin/firebase serve --only functions,hosting
[debug] [2018-02-13T01:11:08.278Z] CLI Version: 3.17.4
[debug] [2018-02-13T01:11:08.278Z] Platform: darwin
[debug] [2018-02-13T01:11:08.278Z] Node Version: v6.11.1
[debug] [2018-02-13T01:11:08.279Z] Time: Tue Feb 13 2018 10:11:08 GMT+0900 (KST)
[debug] [2018-02-13T01:11:08.279Z] -------------------------------------------------------------------
---
[debug]
and nothing thereafter even I trigger something on realtime database...
from firebase-functions.
Don't know why but installing firebase-tools
in node v9.6.1 fix the problem, now npm start
works for bothnode v6.11.5
and node v9.6.1
.
When I install firebase-tools
in v9 shows me some compilation messages but this doesn't happen with v6. Anyway now it's working at last (I spend almost 5 hours looking for a solution).
Hope this "solution" helps someone else.
from firebase-functions.
I was having same issues as @hansanghoon and @ohabash.
Hang after 'Parsing function triggers'...
node v6.11.5
npm 3.10.10
firebase-admin 5.8.2
firebase-functions 0.8.1
firebase-tools 3.17.6
Then I finally saw this.
Ok, my function IS NOT an HTTP function so the hang there is currently expected behavior.
Hope this helps someone else.
In the spirit of "Don't Be Evil", would hope to see an error message or a warning or something other than hang.
from firebase-functions.
I had not done used firebase for a while - so just a reminder, once you run "firebase serve --only functions" , make sure that you load the url given i.e. " http://localhost:5000/*******/*****/functionYouAreRunning " in your browser to trigger the request
from firebase-functions.
➜ Vue-Fullstack-Starter git:(develop) firebase serve --only functions
=== Serving from '/Users/shyamchen/Desktop/Vue-Fullstack-Starter'...
i functions: Preparing to emulate functions.
⚠ functions: Failed to emulate api
⚠ functions: Failed to emulate app
➜ Vue-Fullstack-Starter git:(develop) node -v
v6.14.2
➜ Vue-Fullstack-Starter git:(develop) npm -v
3.10.10
➜ Vue-Fullstack-Starter git:(develop) yarn -v
1.3.2
from firebase-functions.
@Shyam-Chen Please run again with --debug flag and file a new issue.
from firebase-functions.
Same error than @Shyam-Chen. How did you manage to fix the issue?
from firebase-functions.
from firebase-functions.
C:\Program Files\nodejs\project\functions>firebase serve --only functions --debug
[2018-05-19T23:29:38.959Z] ----------------------------------------------------------------------
[2018-05-19T23:29:38.962Z] Command: C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\project\node_modules\firebase-tools\bin\firebase serve --only functions --debug
[2018-05-19T23:29:38.963Z] CLI Version: 3.18.4
[2018-05-19T23:29:38.963Z] Platform: win32
[2018-05-19T23:29:38.963Z] Node Version: v10.1.0
[2018-05-19T23:29:38.963Z] Time: Sun May 20 2018 01:29:38 GMT+0200 (Paris, Madrid (heure d’été))
[2018-05-19T23:29:38.963Z] ----------------------------------------------------------------------
(node:14048) ExperimentalWarning: The fs.promises API is experimental
[2018-05-19T23:29:38.978Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[2018-05-19T23:29:38.978Z] > authorizing via signed-in user
[2018-05-19T23:29:38.981Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/projects/project-11b1e
Sun May 20 2018 01:29:38 GMT+0200 (Paris, Madrid (heure d’été))
[2018-05-19T23:29:39.654Z] <<< HTTP RESPONSE 200 server=nginx, date=Sat, 19 May 2018 23:29:41 GMT, content-type=application/json; charset=utf-8, content-length=114, connection=close, x-content-type-options=nosniff, strict-transport-security=max-age=31536000; includeSubdomains, cache-control=no-cache, no-store
[2018-05-19T23:29:39.656Z] >>> HTTP REQUEST GET https://admin.firebase.com/v1/database/project-11b1e/tokens
Sun May 20 2018 01:29:39 GMT+0200 (Paris, Madrid (heure d’été))
[2018-05-19T23:29:40.228Z] <<< HTTP RESPONSE 200 server=nginx, date=Sat, 19 May 2018 23:29:42 GMT, content-type=application/json; charset=utf-8, content-length=264, connection=close, x-content-type-options=nosniff, strict-transport-security=max-age=31536000; includeSubdomains, cache-control=no-cache, no-store
[2018-05-19T23:29:40.229Z] >>> HTTP REQUEST GET https://cloudresourcemanager.googleapis.com/v1/projects/project-11b1e
Sun May 20 2018 01:29:40 GMT+0200 (Paris, Madrid (heure d’été))
[2018-05-19T23:29:40.958Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Sat, 19 May 2018 23:29:42 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=51303433; quic=51303432; quic=51303431; quic=51303339; quic=51303335,quic=":443"; ma=2592000; v="43,42,41,39,35", accept-ranges=none, connection=close
=== Serving from 'C:\Program Files\nodejs\project'...
i functions: Preparing to emulate functions.
[2018-05-19T23:29:41.596Z] Fetching environment
[2018-05-19T23:29:41.598Z] >>> HTTP REQUEST GET https://mobilesdk-pa.googleapis.com/v1/projects/300108879366:getServerAppConfig
Sun May 20 2018 01:29:41 GMT+0200 (Paris, Madrid (heure d’été))
[2018-05-19T23:29:42.094Z] <<< HTTP RESPONSE 200 content-type=application/json; charset=UTF-8, vary=X-Origin, Referer, Origin,Accept-Encoding, date=Sat, 19 May 2018 23:29:44 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=51303433; quic=51303432; quic=51303431; quic=51303339; quic=51303335,quic=":443"; ma=2592000; v="43,42,41,39,35", accept-ranges=none, connection=close
[2018-05-19T23:29:42.094Z] Starting @google-cloud/functions-emulator
Warning: You're using Node.js v10.1.0 but Google Cloud Functions only supports v6.11.5.
[2018-05-19T23:29:43.615Z] Parsing function triggers
[2018-05-19T23:29:44.130Z] Error while deploying to emulator: RangeError [ERR_OUT_OF_RANGE]: The value of "value" is out of range. It must be >= -2147483648 and <= 2147483647. Received 2185921453
RangeError [ERR_OUT_OF_RANGE]: The value of "value" is out of range. It must be >= -2147483648 and <= 2147483647. Received 2185921453
at checkInt (internal/buffer.js:35:11)
at writeU_Int32LE (internal/buffer.js:515:3)
at Buffer.writeInt32LE (internal/buffer.js:684:10)
at Object.entryHeaderToBinary (C:\Program Files\nodejs\project\node_modules\adm-zip\headers\entryHeader.js:216:18)
at Object.packHeader (C:\Program Files\nodejs\project\node_modules\adm-zip\zipEntry.js:260:39)
at C:\Program Files\nodejs\project\node_modules\adm-zip\zipFile.js:198:41
at Array.forEach ()
at Object.compressToBuffer (C:\Program Files\nodejs\project\node_modules\adm-zip\zipFile.js:182:23)
at Object.writeZip (C:\Program Files\nodejs\project\node_modules\adm-zip\adm-zip.js:454:32)
at client.generateUploadUrl.then.then (C:\Program Files\nodejs\project\node_modules@google-cloud\functions-emulator\src\cli\controller.js:168:13)
! functions: Failed to emulate api
from firebase-functions.
Could you try switching your Node version to v6.11.5, which is the recommended version for emulating functions?
from firebase-functions.
@laurenzlong any suggestions to make it work till the new options are available?
from firebase-functions.
@Swivelgames Thank you.
from firebase-functions.
I found that if you cd into your functions folder and then run firebase serve, it works.
from firebase-functions.
Related Issues (20)
- Function execution took 58984 ms, finished with status: 'timeout' HOT 2
- [Firestore] Error: 4 DEADLINE_EXCEEDED: Deadline exceeded HOT 1
- HTTPS Request returns CORS errors even with the domain added as allowed origin HOT 4
- How to deploy function with latest secrets at RUNTIME? HOT 2
- DocumentOptions do not allow parameterized configuration values HOT 2
- Various Firebase functions started reporting crash: Maximum call stack size exceeded HOT 10
- regression with firebase-functions-test wrapping a v1 scheduled function HOT 2
- Please move `node-fetch` as a `devDependency` HOT 1
- `getDownloadURL` function fails in emulator mode if storage rules are not allowed HOT 3
- Consider exporting `SecretParam` type HOT 3
- CORS error when calling v2 functions using onCall HOT 3
- CallableOptions doesn't accept BooleanParam which is accepted by HttpsOptions HOT 2
- Structured logging error context not being serialized HOT 3
- Don't verify auth token on public endpoints HOT 5
- Firebase Blocking Auth Functions Run Incorrectly on Failed Signup HOT 2
- Module '"firebase-functions/v1"' has no exported member 'onInit'. HOT 5
- Single CORS origin ignored for `onCall` HOT 1
- Auth onCreate trigger doesn't trigger in emulators with magic link sign in flow HOT 2
- Firebase Functions v2 missing labels for documentOnwritten HOT 3
- defineSecret creates a list of values in Secret Manager HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from firebase-functions.