-
Notifications
You must be signed in to change notification settings - Fork 971
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
Next.js cloud function builds failing on first firebase deploy #6446
Comments
I would just like to add that following this guide also leads to the same problem. |
I'm on Mac too, Next 13.4.1 and was on firebase tools 12.4.4 until just updated to 12.7.0 to check if it would fix this issue - it did not. Up until yesterday evening my app had been deploying for months nicely to Firebase framework-aware hosting for Next JS. I made today a couple of small code changes - no new libs, no new config, nothing major like that. And suddenly firebase deploy fails in build step with similar symptoms: sharp & libvips. Checked manually on my Mac to download the sharp-libvips outlined in the error message. Downloaded nicely.
|
...Tried again to deploy this morning. The issue I reported above 15 hours ago is gone - luckily a temporary Cloud Build issue. |
Can anyone solve it? `Building a Cloud Function to run this application. This is needed due to: npm ERR! code 2 npm ERR! A complete log of this run can be found in: Error: An unexpected error has occurred.` |
I am unable to deploy my production firebase functions due to the same error
|
Same issue on fresh firebase init and deploy on Mac |
Please let me know if there are any other logs or info I can send along to help debug - this is a pretty big issue for my company as we cannot deploy updates to our production firebase functions |
Same issue also on MacOS Sonoma
|
Also having the above issue. Clean install, new project, nothing untoward going on. Firebase Functions default code, typescript, |
I was able to deploy by downgrading my firebase tools |
This just happened to me on an M1 Mac, I removed my current version and reinstalled the old [email protected] did the trick
|
Using [email protected] can provide a workaround if you need to deploy to nodejs20. |
thank
thank you! I just had a WTF moment. I can confirm uninstalling and downgrading to 12.0.0 did the trick. |
It seems like there's multiple issues here, although the root of the issues may be the use of
To help diagnose further, I'd appreciate if others still seeing this problem could provide additional logs and details like the versions listed above. |
@JulienMartel My env:
|
I used [email protected] by installed shell command.
|
Same issue here for a pure JS function that's been deployed before without any issues.
|
FYI, my current workaround is removing
from firebase.json. That being done the deployment works, but be aware that you lose the automatic linting on deploy. |
Per the comments and error logs this issue doesn't seem related to the frameworks integration but rather to the Firebase Functions |
Thank you very much! |
Same issue here. I was using node 16. It worked just by switching to node v20.5.1 (npm v10.0.0). |
This help me fix the issue without workarounds: |
I'm having the same problem deploying my functions. I've tried downgrading to the versions mentioned above, reinstalling, removing the lint command line in the firebase.json predeploy, and nothing... I'm trying to do it from macOS Sonoma. When I test using emulators, it works normally. |
I managed to solve it by simply installing firebase-tools in my project directory, not globally: |
I can confirm that lowering the version of firebase tools helped. |
i had the same problem. |
This works for me. Thanks! |
On MacOS Sonoma 14.1.1 I fixed it by removing the version installed with |
new mac, node 20, new install through the bash script, deploy failed for the same reason. It needs more attention from Firebase team. But at least we have workarounds. |
Yes, the version of Firebase Tools installed by curl is completely broken. Needs fixing. |
Problem still exists. Please! |
Can confirm using the bash script caused issues for me. Just delete the globally installed package found with which firebase, and run which again, you'll see it pointing to the right place if you installed with npm. |
This worked for my M1 pro, the problem is in the firebase cli: Caution DO NOT INSTALL: SOLUTION: |
Honestly I don't find having a global install the best approach. Especially since I have multiple projects and one would need to be able to manage the different required versions I simply just include firebase as a dependency and everything is solved with |
Solution firebase.json changes
Hello everyone, My app is next.js v14, firebase, auth and firestore For me using the latest version of firebase-tools and "#firebase deploy --only" functions were working but when I did a full deploy I got this error. I have done a "firebase deploy" test and got an error
I took a look at my firebase.json in the root folder of my app and found it needed some changes. Here is my full firebase.json file, please take a look at the "Hosting" section for the solution
|
Some of you can resolve this error by making sure that you are not running only Delete the .next folder before running the above command. |
|
[REQUIRED] Environment info
firebase-tools: 12.7.0
Platform: macOS
Next: 13.4.19
[REQUIRED] Test case
Added firebase to an existing, simple next app with a couple of
api
endpoints and the cloud function build fails.[REQUIRED] Steps to reproduce
Add firebase with
firebase hosting init
to a next.js application with server side endpoints. runfirebase deploy
[REQUIRED] Expected behavior
The functions build finishes
[REQUIRED] Actual behavior
The text was updated successfully, but these errors were encountered: