firebase / firebase-functions

Firebase SDK for Cloud Functions
https://firebase.google.com/docs/functions/
MIT License
1.01k stars 201 forks source link

Deploy function with the name test-helloWorld fails when using v2 #1522

Closed amit20897 closed 3 months ago

amit20897 commented 4 months ago

Related issues

https://github.com/firebase/firebase-functions/issues/1279

Version info

node: v18.17.1

firebase-functions: ^4.7.0

firebase-tools: 13.2.1

firebase-admin: ^12.0.0

Deploy the function named: test-helloWorld as a onCall v2 function

Steps to reproduce

add the following to index.ts exports['test-helloWorld'] = onCall((request) => { return 'not working'; });

deploy with: firebase deploy --only functions:test-helloWorld

Expected behavior

function being deployed without errors.

Actual behavior

i functions: updating Node.js 18 (2nd Gen) function test-helloWorld(us-central1)... Could not create or update Cloud Run service test-helloworld, Container Healthcheck failed. Revision 'test-helloworld-00001-zox' is not ready and cannot serve traffic. The user-provided container failed to start and listen on the port defined provided by the PORT=8080 environment variable. Logs for this revision might contain more information.

For more troubleshooting guidance, see https://cloud.google.com/run/docs/troubleshooting#container-failed-to-start

Functions deploy had errors with the following functions: test-helloWorld(us-central1) i functions: cleaning up build files...

Error: There was an error deploying functions

Were you able to successfully deploy your functions?

No

google-oss-bot commented 4 months ago

I found a few problems with this issue:

oconnorjoseph commented 4 months ago

I'm running into this issue as well with the following environment:

node: v20.11.0

firebase-functions: 4.7.0

firebase-tools: 13.3.0

firebase-admin: 12.0.0

shaffy9633 commented 4 months ago

same here running into the issue. environment as follows: I'm running into this issue as well with the following environment:

node: v20.11.0

firebase-functions: 4.7.0

firebase-tools: 13.3.0

firebase-admin: 12.0.0

AndrewAsseily commented 4 months ago

I am also running into the above issue. Same as @oconnorjoseph and @shaffy9633

builtbyjavi commented 4 months ago

Any updates ? Also facing a similar issue with the following environment:

node (v20.11.0), firebase-functions (4.7.0), firebase-tools (13.3.0), firebase-admin (12.0.0)

inlined commented 3 months ago

Unfortunately, many many years ago we gave "-" special meaning in functions and reverse compatibility ties our hands. If you want to export a function with a hyphen in its name, use object embedding. For example:

export test {
  helloWorld: onCall((request) => {
    return 'now working';
  }),
}

This will also give you the additional feature of being able to deploy all functions inside the "test" object with a single --only command: e.g. firebase deploy --only functions:test or firebase deploy --only functions:test.helloWorld