Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Electron build error with Bun and pnpm because of package.json and lockfile mismatch #17085

Closed
philfontaine opened this issue Apr 4, 2024 · 2 comments
Assignees
Labels
area/cli bug/1-hard-to-reproduce A reproduction is available, but it's hard to reproduce, so it has a lower priority. bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-vite kind/bug 🐞 mode/electron Qv2 🔝 Quasar v2 issues

Comments

@philfontaine
Copy link
Contributor

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.

image

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?

  1. Created a new quasar project
  2. Added electron mode
  3. 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

@github-actions github-actions bot added area/cli bug/1-hard-to-reproduce A reproduction is available, but it's hard to reproduce, so it has a lower priority. bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-vite mode/electron labels Apr 4, 2024
@lizhongyue248
Copy link

Thank you, it has been very helpful to me

@rstoenescu
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli bug/1-hard-to-reproduce A reproduction is available, but it's hard to reproduce, so it has a lower priority. bug/1-repro-available A reproduction is available and needs to be confirmed. flavour/quasar-cli-vite kind/bug 🐞 mode/electron Qv2 🔝 Quasar v2 issues
Projects
None yet
Development

No branches or pull requests

3 participants