Open KalebKloppe opened 2 weeks ago
The workspace:
format is something native to PNPM, so NPM doesn't understand it.
Isolate-package will bundle everything so the folder is self-contained to be installed and executed, but it doesn't change the package manager.
I think this problem is really the responsibility of the build pipeline. Is should detect from your manifest and lockfile, that you're using PNPM and use that instead. So it seems Firebase just doesn't support pnpm correctly here.
Isolate-package had an option that forced the output to be NPM format, so you could have used that, but unfortunately I have removed the feature because there wasn't a clear use-case anymore.
I can bring it back probably. I'll have a look. Then at least you have a workaround...
I have published isolate-package@next
I don't have time to publish firebase-tools-with-isolate now, but you should be able to use that package directly. Add a isolate.config.json file with forceNpm: true
.
The firebase deployment is a little different that way. Add isolate
as a build step in firebase.json and point source to "./isolate" => then deploy with the official firebase-tools
Wow, thank you for throwing that version up so quickly! I will try it with isolate-package@next
and forceNpm:true
Good luck, and let me know if it worked out, then I will publish it as the next stable version and update firebase-tools-with-isolate
Hey @0x80,
Unfortunately, I can't tell you if isolate-tools@next
works or not. I tried to configure the normal isolate-package
back in May, but ended up using firebase-tools-with-isolate
at that time. I gave isolate-package a try again yesterday, but still couldn't configure it properly.
We solved our issue by moving from Firebase Hosting to Firebase App Hosting. It works better with Next.js, monorepos, and pnpm. But, we continue to use firebase-tools-with-isolate
to deploy our FireCMS admin panel and Cloud Functions.
Switching to Firebase App Hosting has been on our roadmap since it was announced earlier this year. Support for Next.js on regular Hosting was always "experimental", and I doubt Google will continue to support it since App Hosting now exists. Maybe that is part of why they never adopted isolate officially?
It seems like you could direct people to Firebase App Hosting if you wanted to close this issue.
Problem
When I deploy a Next.Js app on Firebase Hosting in a pnpm monorepo using
firebase-tools-with-isolate
❌ Next.Js with Cloud Functions (image optimization, SSR, etc.) fails
npm error code EUNSUPPORTEDPROTOCOL npm error Unsupported URL Type "workspace:": workspace:*