simondotm / nx-firebase

Firebase plugin for Nx Monorepos
https://www.npmjs.com/package/@simondotm/nx-firebase
MIT License
175 stars 31 forks source link

Confusing functions deploy error when switching to pnpm, might be exposing a package.json bug #193

Closed Lowell20 closed 3 months ago

Lowell20 commented 3 months ago

Deploying Firebase functions from github actions workflow. Getting errors that my lockfile and package.json are not in sync. It's using the lockfile from the workspace root package.json, and using packages from the project firebase directory package.json

apps/projectName/functions/package.json

I do have the function packages.json and pnpm-lock.yaml in the build directory, where pnpm-lock.yaml is generated during the functions build

I found a workaround by changing the nx.json:cli:packageManager to "npm" on the fly in workflow, but then also have to maintain a root package-lock.json file alongside the pnpm-lock.yaml file.

I believe this works because npm does not force the lockfile to be in sync with the functions package.json.

Please let me know if there is something I need to adjust, or if this is possibly a bug of some kind.

Lowell20 commented 3 months ago

seems like this may be working now, all I think I did was to add the "@google-cloud/functions-framework" dependency to both the root package.json and the project/functions/package.json

simondotm commented 3 months ago

@Lowell20 thanks for sharing this. I've read elsewhere that Cloud Functions does support pnpm but as you've found, that dependency needs to be added.