firebase-framework-tools
firebase-framework-tools copied to clipboard
Firebase deploy with NextJS peer dependencies issues
As stated in the title, when running Firebase deploy on a NextJS app with peer dependency issues, the command fails with the expected unable to resolve dependency tree. Is there a way to pass in the --legacy-peer-deps flag to this command?
EDIT: tried adding an npmrc file to the root of the project but it does not get added to the functions directory built from the deploy command
if this is related to cloud functions deploy, that should be handled inside the functions package.json, need a confirmation on this.
found some tips, this is often related to the dependencies not being installed, you can re-install the packages to a specific version and append the command onto it npm add xxxx --legacy-peer-deps
another, if this is related to react, is to install a specific version of React and facilitate tree shaking where needed. this could apply to other packages but from my search, it seems to be an issue with older React libraries designed for node 7 and older.
found some tips, this is often related to the dependencies not being installed, you can re-install the packages to a specific version and append the command onto it
npm add xxxx --legacy-peer-depsanother, if this is related to react, is to install a specific version of React and facilitate tree shaking where needed. this could apply to other packages but from my search, it seems to be an issue with older React libraries designed for node 7 and older.
Thanks for the response. The issue with these solutions is that running ‘firebase deploy’ on a NextJS app will automatically build the functions folder and deploy. So any attempt to modify package.json or the npm flags gets overwritten immediately.
Unfortunately in my scenario this is not an app that I have written and has dozens of peer dependency issues from the previous developers, so changing the version of React won’t solve the issue either.
There should be a way to specify a flag or something on the firebase deploy command to insert your own npm config
Interesting, probably worth us copying over any npmrc into the code generated Cloud Function
Interesting, probably worth us copying over any npmrc into the code generated Cloud Function
@jamesdaniels thanks. Is there a timeline for this update?