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.
What happened?
When building for electron, a new package.json file is created and copied to the
UnPackaged
which only contains thedependencies
, i.e. without thedevDependencies
.The lockfile is also copied to that folder.
When running
bun install
orpnpm install
, there will be a mismatch between the newpackage.json
and the lockfile since the devDependencies are included in the lockfile, but are not found in thepackage.json
.This is my workaround:
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?
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