Electron build error with Bun and pnpm because of package.json and lockfile mismatch
philfontaine opened this issue · comments
What happened?
When building for electron, a new package.json file is created and copied to the UnPackaged
which only contains the dependencies
, i.e. without the devDependencies
.
The lockfile is also copied to that folder.
When running bun install
or pnpm install
, there will be a mismatch between the new package.json
and the lockfile since the devDependencies are included in the lockfile, but are not found in the package.json
.
This is my workaround:
// This is a workaround. By default, the lock file is copied to the UnPackaged folder. However, the dev dependencies
// are not copied to the package.json file. This creates a mismatch between the package.json and the lockfile,
// resulting in an error.
unPackagedInstallParams: ['install', '--prod', '--no-frozen-lockfile'],
Note: in PNPM it only fails in the CI since the --frozen-lockfile
is only set by default if it detects a CI environment. In Bun, it also fails locally since --frozen-lockfile
is set by default.
What did you expect to happen?
The workaround is implemented inside quasar so there are no build error by default.
Note: The workaround is not perfect, we indeed would normally want the lockfile to be frozen, especially in the CI. But it seems impossible because of the mismatch.
Reproduction URL
https://github.com/philfontaine/quasar-bug-electron-build-bun-pnpm
How to reproduce?
- Created a new quasar project
- Added electron mode
- Ran quasar build -m electron
Flavour
Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)
Areas
Quasar CLI Commands/Configuration (@quasar/cli | @quasar/app-webpack | @quasar/app-vite), Electron Mode
Platforms/Browsers
Electron
Quasar info output
No response
Relevant log output
No response
Additional context
No response
Thank you, it has been very helpful to me
Fix for Bun and PNPM will be available in:
- q/app-vite v2.0.0-beta.11
- q/app-vite v1.8.5
- q/app-webpack v4.0.0-beta.12
- q/app-webpack v3.12.8