You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add an overrides definition to the root of the workspace. Pnpm requires this to be defined at the root level
Use packager: pnpm and mark a dependency as external
Run sls package in the package. This works
Run CI=true sls package in the package. You will get ERR_PNPM_LOCKFILE_CONFIG_MISMATCH Cannot proceed with the frozen installation. The current "overrides" configuration doesn't match the value found in the lockfile. This appears to be due to pnpm prune enforcing --frozen-lockfile in a CI environment
Additional context
During some debugging, I found that the pnpm install step with the copied dependencies works, as that manually passes in --no-frozen-lockfile. This fails on the pnpm prune step. prune does not appear to support a --no-frozen-lockfile step. I don't exactly understand what pnpm prune is accomplishing in this case either as we are only copying over production dependencies from the package.json file. Do we see an issue with either not calling prune or using the ignoreLockfile argument added for yarn and using that to conditionally not run prune for pnpm?
Alternatively, we could update the pnpm packager to copy over the pnpm.overrides configuration from the root package.json? This might be more correct as the overrides definition can change the resolved versions of modules that are installed.
The text was updated successfully, but these errors were encountered:
Describe the bug
When using
overrides
in apnpm
monorepo, packaging will always break on theprune
step due to the overrides not being included.To Reproduce
https://github.com/loganyott/serverless-esbuild-pnpm-prune-example
In the repo, run
pnpm install
cd package-one
CI=true pnpm build
For any other repo,
overrides
definition to the root of the workspace. Pnpm requires this to be defined at the root levelpackager: pnpm
and mark a dependency asexternal
sls package
in the package. This worksCI=true sls package
in the package. You will getERR_PNPM_LOCKFILE_CONFIG_MISMATCH Cannot proceed with the frozen installation. The current "overrides" configuration doesn't match the value found in the lockfile
. This appears to be due topnpm prune
enforcing--frozen-lockfile
in a CI environmentExpected behavior
CI=true sls package
executes successfullyScreenshots or Logs
If applicable, add screenshots or logs to help explain your problem.
Versions (please complete the following information):
Additional context
During some debugging, I found that the
pnpm install
step with the copied dependencies works, as that manually passes in--no-frozen-lockfile
. This fails on thepnpm prune
step.prune
does not appear to support a--no-frozen-lockfile
step. I don't exactly understand whatpnpm prune
is accomplishing in this case either as we are only copying over production dependencies from thepackage.json
file. Do we see an issue with either not callingprune
or using theignoreLockfile
argument added for yarn and using that to conditionally not run prune for pnpm?Alternatively, we could update the pnpm packager to copy over the
pnpm.overrides
configuration from the rootpackage.json
? This might be more correct as the overrides definition can change the resolved versions of modules that are installed.The text was updated successfully, but these errors were encountered: