Object.values ​​() in Cloud Firebase Functions

I am trying to use Object.values()

in one of my Firebase Cloud Features but not recognized as a feature. I guess this means es7 features are not available in Firebase cloud features. My question is twofold:

First, is it true? Secondly, I understand that the feature is not supported by some browsers, but I am wondering if this is important for Firebase Cloud Functions. Can someone explain this to me?

+4


source to share


3 answers


According to node.green, Firebase only supports the LTS version of Node, which is currently in version 6.10.x and Object.values

is still behind the experimental flag in Node 6.10.x.



Hope this cleared your doubts!

+7


source


Go to the same problem. have a look at this answer which recommends using a function Object.keys

and bind it to the built-in function map

that comes with the array prototype.



+1


source


Node 8 is now available for cloud functionality. Try updating your environment.

You probably just need:

  • Add "engine": {"node": "8"} to your /functions/package.json. An example .

If this still doesn't work:

  • Update your firebase functions to the latest version
  • Update firebase-tools to the latest version
0


source







All Articles