admin管理员组

文章数量:1391918

I'm attempting to use Object.values() in one of my Firebase Cloud Functions, but it isn't recognized as a function. I assume this means that es7 functions aren't available on Firebase Cloud Functions. My question is two-fold:

First, is this true? Second, I recognize that the function isn't supported by some browsers, but I wonder if that's important for Firebase Cloud Functions. Can anyone explain this to me?

I'm attempting to use Object.values() in one of my Firebase Cloud Functions, but it isn't recognized as a function. I assume this means that es7 functions aren't available on Firebase Cloud Functions. My question is two-fold:

First, is this true? Second, I recognize that the function isn't supported by some browsers, but I wonder if that's important for Firebase Cloud Functions. Can anyone explain this to me?

Share Improve this question asked Mar 23, 2017 at 4:37 J. Adam ConnorJ. Adam Connor 1,7344 gold badges21 silver badges38 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 7

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

Hope this cleared your doubt!

Ran into the same issue. check out this answer that remends using the Object.keys function and chaining it to the built in map function that es with the array prototype.

Node 8 is available for cloud functions now. Try upgrading your environment.

You probably just need to:

  • Add "engines": { "node": "8" } to your /functions/package.json. Example.

In case it still doesn't work:

  • Upgrade your firebase-functions to the latest version
  • Upgrade firebase-tools to the latest version

本文标签: javascriptObjectvalues() in Firebase Cloud FunctionsStack Overflow