firebase / firebase-tools

The Firebase Command Line Tools
MIT License
3.98k stars 918 forks source link

Next.js framework not detected in GitHub Action #6863

Closed deltaepsilon closed 3 days ago

deltaepsilon commented 4 months ago

Environment info

firebase-tools: 12.7.0

Platform: Ubuntu 22.04.3 LTS

Test case

I'm starting a fresh project with GitHub and the Next.js framework integration. I started from scratch this morning, and everything went well. I was able to deploy from my local machine and hosting picked it up.

Steps to reproduce

  1. I pushed to GitHub to make sure the integration was working and got the following error: image

  2. I added the env variable and pushed to master: image

  3. I got another error: image

Could not determine the web framework in use.
  ***
    "status": "error",
    "error": "Unable to detect the web framework in use, check firebase-debug.log for more info.\n\n\u001b[1mDocumentation:\u001b[[22](https://github.com/deltaepsilon/investor-portal/actions/runs/8214803231/job/22467610748#step:4:25)m [https://firebase.google.com/docs/hosting/frameworks/frameworks-overview\n\u001b[1mFile](https://firebase.google.com/docs/hosting/frameworks/frameworks-overview/n/u001b[1mFile) a bug:\u001b[22m https://github.com/firebase/firebase-tools/issues/new?template=bug_report.md\n\u001b[1mSubmit a feature request:\u001b[22m https://github.com/firebase/firebase-tools/issues/new?template=feature_request.md\n\nWe'd love to learn from you. Express your interest in helping us shape the future of Firebase Hosting: https://goo.gle/41enW5X"
  ***
  1. I tried switching the hosting.source key to hosting.public in firebase.json. That got rid of the error, but then my site didn't deploy. I got the dreaded "index.html missing" error page.

Expected behavior

I expected the GitHub deploy to work first try without any intervention, as I was using the default firebase init workflow.

Actual behavior

I got a series of two different errors in my GitHub Actions as described above ☝️

aalej commented 4 months ago

Hey @deltaepsilon, thanks for the report and for sharing the error logs you encountered. I’m able to reproduce this issue. I'll raise this to our engineering team to see what we can do here, and I’ll be marking this as reproducible.

ibrahimtuna commented 4 months ago

Hi,

facing same issue

kristianbang commented 1 week ago

I had same issue here for an Astro project but got it fixed by adding - run: npm ci e.g: jobs: build_and_deploy: runs-on: ubuntu-latest steps: