Skip to content

Any version after 11.17.0 fails to deploy (Failed to find location of Firebase Functions SDK) #5822

Closed

Description

@snorreks

If i try to use any versions after firebase-tools 11.17.0, i get "Failed to find location of Firebase Functions SDK" error. I have also tried the latest firebase-tools 12.0.0, and i get the same error. I have tried to uninstall and install firebase-tools again. Using pnpm and global.
firebase deploy --only functions
pnpm firebase deploy --only functions
But get the same error.

[REQUIRED] Version info

node: 18.14.2

firebase-functions: 4.4.0

firebase-tools: 11.17.0

firebase-admin: 11.8.0

os: Windows 11 Pro, 22H2, 22621.1105

[REQUIRED] Steps to reproduce

  1. Deploy any function using firebase deploy --only functions
  2. Notice that no function can deploy.

[REQUIRED] Expected behavior

Expect to deploy the functions.

[REQUIRED] Actual behavior

firebase-debug.log

Were you able to successfully deploy your functions?

No. I get this error

i  deploying functions
i  functions: preparing codebase default for deployment
i  functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i  functions: ensuring required API cloudbuild.googleapis.com is enabled...
i  artifactregistry: ensuring required API artifactregistry.googleapis.com is enabled...
+  artifactregistry: required API artifactregistry.googleapis.com is enabled
+  functions: required API cloudbuild.googleapis.com is enabled
+  functions: required API cloudfunctions.googleapis.com is enabled

Error: Failed to find location of Firebase Functions SDK. Please file a bug on Github (https://github.com/firebase/firebase-tools/).

Activity

  1. aalej commented on May 10, 2023

    @aalej
    Contributor

    Hi @snorreks, I am unable to replicate the issue you mentioned. I tried creating a new project to deploy functions and I did not encounter any issues while deploying. I’m not sure if I may be missing something to properly replicate this. Could you provide more details on how you set up your project, and if you’re able to reproduce the issue in a fresh project? Thanks!

    I’m using the following to replicate this issue:
    platform: macOS
    firebase-tools: v12.0.0
    node: v18.15.0
    firebase-admin: 11.8.0
    firebase-functions: 4.4.0

  2. added
    Needs: Author Feedback
    on May 10, 2023
  3. snorreks commented on May 11, 2023

    @snorreks
    Author

    I have created a minimal example using pnpm and esbuild, it looks like that pnpm was the issue after all.
    https://github.com/snorreks/firebase-tools-pnpm-sdk-location-bug

  4. added and removed
    Needs: Author Feedback
    on May 11, 2023
  5. self-assigned this
    on May 11, 2023
  6. colerogers commented on May 11, 2023

    @colerogers
    Contributor

    Hi @snorreks this issue with monorepos and pnpm has been around for a while (here's a large feature request thread on it: #653). We recently patched the discovery process to try and support some pnpm setup (see: #5517). Here's where we check for your firebase-functions binary in code:

    // Location of the binary included in the Firebase Functions SDK
    .

    Would it be possible to move around your repo structure?

  7. added
    Needs: Author Feedback
    and removed on May 11, 2023
  8. colerogers commented on May 11, 2023

    @colerogers
    Contributor

    Also, I tried out the sample and I'm also unable to reproduce the bug

  9. snorreks commented on May 12, 2023

    @snorreks
    Author

    I see, it worked when you changed firebase-tools to 12.0.0, and ran pnpm i? Are you using windows?

    It is not possible to move around the repo structure. I am using nx, pnpm and nx-cloud-functions-deployer, it is working with firebase-tools 11.17.0 and lower.

    Do you think a quick fix is to create npm package wrapper:

    - root (pnpm)
      - package layer (npm)
        - deploy function folder
    

    where npm package layer only have firebase-functions installed?

    Do you know if /src/deploy/functions/runtimes/node/index.ts changed after 11.17.0?

  10. added and removed
    Needs: Author Feedback
    on May 12, 2023
  11. russellwheatley commented on Nov 10, 2023

    @russellwheatley
    Member

    Hey @snorreks - did you manage to resolve your issue?

  12. added
    Needs: Author Feedback
    on Nov 10, 2023
  13. google-oss-bot commented on Nov 21, 2023

    @google-oss-bot
    Collaborator

    Hey @snorreks. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 3 days I will close it automatically.

    If you have more information that will help us get to the bottom of this, just add a comment!

  14. google-oss-bot commented on Nov 24, 2023

    @google-oss-bot
    Collaborator

    Since there haven't been any recent updates here, I am going to close this issue.

    @snorreks if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions