Skip to content

Webframeworks project deployment fails on v14 #8378

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nvzoll opened this issue Mar 27, 2025 · 23 comments · Fixed by #8381 or SharezoneApp/sharezone-app#1851
Closed

Webframeworks project deployment fails on v14 #8378

nvzoll opened this issue Mar 27, 2025 · 23 comments · Fixed by #8381 or SharezoneApp/sharezone-app#1851

Comments

@nvzoll
Copy link

nvzoll commented Mar 27, 2025

[REQUIRED] Environment info

firebase-tools: v14.0.0

Platform: ubuntu (github action)

[REQUIRED] Test case

npx firebase-tools@latest hosting:channel:deploy <channel> --only production --expires 7d --project <my-gcloud-project> --json
or
npx firebase-tools@latest deploy --only hosting:production --project <my-gcloud-project> --json

[REQUIRED] Steps to reproduce

  1. Next.js 15 project, pages router, use the command above

[REQUIRED] Expected behavior

Project deploys (still happens with v13.35.1)

[REQUIRED] Actual behavior

Initial run:

functions: No cleanup policy detected for repositories in us-central1. This may result in a small monthly bill as container images accumulate over time. 
  
  Error: Functions successfully deployed but could not set up cleanup policy in location us-central1. Pass the --force option to automatically set up a cleanup policy or run 'firebase functions:artifacts:setpolicy' to manually set up a cleanup policy.

After adjusting the settings:

[2025-03-27T20:18:38.469Z] Functions deploy failed.
  [2025-03-27T20:18:38.470Z] ***
  [2025-03-27T20:18:38.470Z] TypeError: Cannot read properties of null (reading 'length')
      at Object.formatServiceAccount (/home/runner/.npm/_npx/ba4f1959e38407b5/node_modules/firebase-tools/lib/gcp/proto.js:95:24)
      at /home/runner/.npm/_npx/ba4f1959e38407b5/node_modules/firebase-tools/lib/gcp/cloudfunctionsv2.js:196:122
      at Object.convertIfPresent (/home/runner/.npm/_npx/ba4f1959e38407b5/node_modules/firebase-tools/lib/gcp/proto.js:45:25)
      at Object.functionFromEndpoint (/home/runner/.npm/_npx/ba4f1959e38407b5/node_modules/firebase-tools/lib/gcp/cloudfunctionsv2.js:196:11)
      at Fabricator.updateV2Function (/home/runner/.npm/_npx/ba4f1959e38407b5/node_modules/firebase-tools/lib/deploy/functions/release/fabricator.js:384:35)
      at Fabricator.updateEndpoint (/home/runner/.npm/_npx/ba4f1959e38407b5/node_modules/firebase-tools/lib/deploy/functions/release/fabricator.js:155:24)
      at /home/runner/.npm/_npx/ba4f1959e38407b5/node_modules/firebase-tools/lib/deploy/functions/release/fabricator.js:110:71
      at handle (/home/runner/.npm/_npx/ba4f1959e38407b5/node_modules/firebase-tools/lib/deploy/functions/release/fabricator.js:89:23)
      at Fabricator.applyChangeset (/home/runner/.npm/_npx/ba4f1959e38407b5/node_modules/firebase-tools/lib/deploy/functions/release/fabricator.js:110:26)
      at /home/runner/.npm/_npx/ba4f1959e38407b5/node_modules/firebase-tools/lib/deploy/functions/release/fabricator.js:69:40
  
  Error: There was an error deploying functions
  
  The process '/usr/local/bin/npx' failed with exit code 2
@nvzoll
Copy link
Author

nvzoll commented Mar 27, 2025

Github action: FirebaseExtended/action-hosting-deploy@v0

@LucianoGanga
Copy link

Hello! I'm having the exact same issue. And I imagine a lot more people will have it soon. By default my deploy script installs the latest firebase-tool package. I was fighting for the last 2 and a half hours with our code until I saw that the version 14 of this package was published ~3h ago.

The only breaking change I see in the release notes, related to cloud functions is this:

BREAKING(cloud functions)! Removed the experimental:functions:shell command. Use functions:shell instead.
so I don't understand what happened, because we're not using that command.

Anyhow, the fix that worked for us:

npm install -g firebase-tools@13 

Thanks!

@OutdatedGuy
Copy link
Contributor

OutdatedGuy commented Mar 27, 2025

Image

I think the issue is related to the above warning we used to get in firebase-tools@13. For more informations.

@nvzoll
Copy link
Author

nvzoll commented Mar 27, 2025

@OutdatedGuy actually, FirebaseExtended/action-hosting-deploy@v0 I referred above does use GOOGLE_APPLICATION_CREDENTIALS
https://github.com/FirebaseExtended/action-hosting-deploy/blob/main/src/deploy.ts#L102

@OutdatedGuy
Copy link
Contributor

Can you give details about how your FirebaseExtended/action-hosting-deploy@v0 step is configured for actions?

@nvzoll
Copy link
Author

nvzoll commented Mar 27, 2025

Sure

- run: |
                  export NODE_OPTIONS=--max_old_space_size=4096
                  npm ci && npm run build
            - uses: FirebaseExtended/action-hosting-deploy@v0
              with:
                  repoToken: '${{ secrets.GITHUB_TOKEN }}'
                  firebaseServiceAccount: '${{ secrets.<service account json content>}}'
                  channelId: live
                  projectId: <my-project>
                  target: production
              env:
                  FIREBASE_CLI_EXPERIMENTS: webframeworks

@haggbart
Copy link

haggbart commented Mar 27, 2025

I'm experiencing the exact same issue with Firebase CLI v14.0.0. The error occurs even on a fresh project.

Fix #8378 (comment) works

@sufyankhatri
Copy link

I'm experiencing the exact same issue with Firebase CLI v14.0.0. The error occurs even on a fresh project

@service-paradis
Copy link

I though I was crazy! Similar problems here with FirebaseExtended/[email protected] which installed [email protected]

@ph360
Copy link

ph360 commented Mar 28, 2025

Image

When I deploy my functions since github show me the same error.

@redian
Copy link

redian commented Mar 28, 2025

If you are using FirebaseExtended/action-hosting-deploy@v0 action and facing this issue, you can force firebase-tools version using the firebaseToolsVersion config on the GA job.

Something like this would work:

      - name: Deploy to Firebase
        uses: FirebaseExtended/action-hosting-deploy@v0
        env:
          FIREBASE_CLI_EXPERIMENTS: webframeworks
        with:
          firebaseToolsVersion: 13.35.1
          ...

@nvzoll
Copy link
Author

nvzoll commented Mar 28, 2025

@redian that's exactly what we did, thanks

@taeold
Copy link
Contributor

taeold commented Mar 28, 2025

We've released a new version with a fix (14.0.1). Sorry for the confusion everyone.

@nvzoll
Copy link
Author

nvzoll commented Mar 28, 2025

Thank you! I guess we'll stick to v13 for a week just in case...

@ph360
Copy link

ph360 commented Mar 29, 2025

Already is ready this version npm install -g [email protected]

@fivecar
Copy link
Contributor

fivecar commented Mar 29, 2025

@taeold : I still get this on 14.0.1, as recent as an hour ago running npx firebase-tools deploy --token "$FIREBASE_TOKEN" --project MY-PROJ --only functions in a GitHub action on the server. Are there potentially still cases where 14.0.1 still fails in this way?

@ph360
Copy link

ph360 commented Mar 29, 2025

@taeold : I still get this on 14.0.1, as recent as an hour ago running npx firebase-tools deploy --token "$FIREBASE_TOKEN" --project MY-PROJ --only functions in a GitHub action on the server. Are there potentially still cases where 14.0.1 still fails in this way?

Image

in github all ok with version 14.0.1

@fivecar
Copy link
Contributor

fivecar commented Mar 29, 2025

FWIW, 14.0.1 still not ok in my case.
Image

Image

@ph360
Copy link

ph360 commented Mar 29, 2025

FWIW, 14.0.1 still not ok in my case. Image

Image

Image

@ph360
Copy link

ph360 commented Mar 29, 2025

FWIW, 14.0.1 still not ok in my case. Image
Image

Image

I believe that message is for other reason. I see that see the policy

@vamshiOmniWorks
Copy link

This worked for me

  • uses: FirebaseExtended/action-hosting-deploy@v0
    with:
    repoToken: "${{ secrets.GITHUB_TOKEN }}"
    firebaseServiceAccount: "${{ secrets.xxx }}"
    channelId: live
    projectId: xxx
    expires: 30d
    firebaseToolsVersion: 13.35.1

nilsreichardt added a commit to SharezoneApp/sharezone-app that referenced this issue Apr 13, 2025
@nilsreichardt
Copy link
Contributor

I am using Firebase CLI v14.1.0 and still get the error.

Here you see that I'm using v14.1.0

Image

Error:

Image

Logs: https://github.com/SharezoneApp/sharezone-app/actions/runs/14430710787/job/40465822063?pr=1849

nilsreichardt added a commit to SharezoneApp/sharezone-app that referenced this issue Apr 16, 2025
firebase/firebase-tools#8378 (comment)
mentioned that 14.0.1 fixed the issue with the Next.js deployment
failure but the still exist, see my comment:
firebase/firebase-tools#8378 (comment).
According to [this
comment](firebase/firebase-tools#8378 (comment)),
we can use Firebase CLI v13 instead of v14 as a workaround for now
(should be fixed in the next few weeks).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet