0x80 / isolate-package

Isolate a monorepo package with its internal dependencies to form a self-contained directory with a pruned lockfile
MIT License
121 stars 13 forks source link

Isolated pnpm lockfile is missing overrides #86

Closed Nr9 closed 4 months ago

Nr9 commented 5 months ago

Using pnpm, when deploying to firebase we have the following error:

Scope: all 11 workspace projects
 ERR_PNPM_LOCKFILE_CONFIG_MISMATCH  Cannot proceed with the frozen installation. The current "overrides" configuration doesn't match the value found in the lockfile

Update your lockfile using "pnpm install --no-frozen-lockfile"; Error ID: be874b7a
Build failed with status: FAILURE and message: installing pnpm dependencies: (error ID: 8622936f):

The created pnpm-lock.yaml does not contain the overrides section from the original pnpm-lock.yaml

Note: we are migrating our project from npm to pnpm. Isolate works correctly when using npm

0x80 commented 5 months ago

Overrides were taken out explicitly to solve someone else's issue with them. See #55. I don't have experience with them myself, but if they are essential some time and breaking things some other time, we could make it a configuration option to include/exclude them.

I didn't remember correctly what we did for #55. The overrides from the root manifest are copied over to the isolated manifest. But apparently that is not sufficient for all situations.

Are your overrides specified in the root manifest? What version of PNPM are you using?

0x80 commented 5 months ago

I can reproduce the issue with an override in the root manifest with pnpm v9. Possibly the previous solution only worked for v8 or the lockfile pruning that I added later messed things up...

I'm not doing anything special for NPM so possibly it works there because the overrides are being ignored completely.

0x80 commented 5 months ago

It appears that the later added prune step is stripping the overrides from the lockfile. I have added them back and published isolate-package@1.17.0-0 under tag next.

I've tested it on my mono-ts boilerplate and there it works.

Please give it a try an see if it works for you. Then I will publish it as a regular version.

Nr9 commented 4 months ago

Tested deploy with new version. It works! Thank you.