When deploying to firebase functions, I had an error occur during post-install script due to missing dependency. I'll be honest that I was surprised it was even being run. I've come to the realization I don't really understand what gets run during deployment.
I suspect it's something like:
npm install --production
npm run build
The issue I'm having is that it cannot find a dependency for post-install, which i suspect it's not installing dev dependencies.
Are there are a list of things that occur when you push to firebase functions?
Related
I am beginner and am working on a quasar project. I tried to upgrade my firebase to version 9. I just ran the npm i firebase#9.13.0
when I run npm audit, this shows up
Since this does not rely on the code in the firebase init, I do not know what to do.
I ran into this error when trying to build nextjs commerce into an existing monorepo. There were a slew of other errors resulting from switching to yarn workspaces and turbo, but this one was the most cryptic. I was able to determine that the files in the repo were perfectly fine by successfully deploying the same files in a different repo and different project. So the question is WHY IS THIS HAPPENING only for this project deploy on Vercel in my monorepo?
This can be caused if you have next#latest as one of the dependencies in a related project. If you examine the failing build's warnings carefully you will notice:
warning Pattern ["next#latest"] is trying to unpack in the same destination "/vercel/.cache/yarn/v6/npm-next-12.1.5-7a07687579ddce61ee519493e1c178d83abac063-integrity/node_modules/next" as pattern ["next#^12.0.8","next#^12.0.8","next#^12.0.8","next#^12.0.8"]. This could result in non-deterministic behavior, skipping.
This is the revealing error. The manifested problem in my case was that the error above. However I suspect it could show up in other ways. This is just one of the gotchas you should be aware of if using yarn workspaces. Moved to next#latest to ^12.0.8 and suddenly all problems will vanish. You're welcome. Don't waste a day on this like I did.
using express app as function. my functions engines:node was set to 12. I had to upgrade node locally -- so I also updated engines:node to 16. suddenly couldn't deploy the functions, I reverted back to engines:node 12. Still can't deploy functions. Seeing this error:
Missing URI for HTTPS function in printTriggerUrls. This shouldn't happen
And a bunch of messages referring to previously deployed functions:
Could not find image for function
Extremely frustrated... tried reinstalling all the local npm packages with no luck.
The solution that finally worked was to delete all the previously deployed functions and re-deploy all the functions fresh.
Try running this command to see the logs
firebase functions:log
Trying to deploy firebase functions..which deploys fine after giving warning on the first try
console warning:
Functions deploy had errors with the following functions:
To try redeploying those functions, run:
firebase deploy --only functions:
To continue deploying other features (such as database), run:
firebase deploy --except functions
redeploying does not give any error in console and functions deploys without any problem
but calling the function does not show any logs in firebase console, while giving this error in chrome console
Error: Forbidden
Your client does not have permission to get URL /sampleFunc from this server.
So I contacted firebase support and there seems to be an issue with functions:
here is what they replied:
There is an ongoing issue with the deployment of new functions as they are deployed as private, please update to the latest version 8.0.0 of the CLI with the command: npm install -g firebase-tools, which it might fix the error.
Our engineering team is already working to solve this issue, however there is no tell on when this fix will be released. At the moment the only workaround for this is to manually set a function to public using Cloud Console or gcloud CLI.
Let me know if you have more questions
Cheers,
Recently found out what is Firebase and started studying it. I need Firebase functions for the server side of my project so I was trying to see how they work but unsuccessfully.
They have nice "little" collection of functions examples there. I tried to start few of them like image-maker but none of them worked for me. Image maker shows me this errors while serving the local server for it:
! functions: Failed to load functions source code. Ensure that you
have the latest SDK by running npm i --save firebase-functions inside
the functions directory.
! functions: Error from emulator.
FirebaseError: Error parsing triggers: Cannot find module
'canvas-prebuilt'
I have no idea what are they talking about. I installed everything by Firebase tutorial through firebase init.
I have:
npm -v: 5.5.1
node --version: v8.9.1
I don't know how to check for Firebase version but I guess I have the latest one since I have just installed it. How can I fix this problem and actually try the functions? Can these functions samples be outdated? Where can I find the better ones?