Skip to content

Bug when using pnpm v10 + Electron #18139

@philfontaine

Description

@philfontaine

What happened?

When using pnpm v10, it now asks to approve builds using pnpm approve-builds. Approving electron is necessary for electron to work in dev using quasar dev -m electron.

Approving dependencies will create a file called pnpm-workspace.yaml with the following content

onlyBuiltDependencies:
  - electron
  - esbuild

When building using quasar build -m electron, pnpm will detect the presence of a workspace because of this newly created yaml file. When installing the production node_modules inside dist/electron/UnPackaged, pnpm will try to install the node_modules at the project root instead of inside this sub-directory. Doing so, pnpm will first purge the exisiting node_modules, and the build will fail.

The workaround is to add --ignore-workspace in the pnpm install --prod command.

What did you expect to happen?

The build should succeed.

Reproduction URL

https://github.com/philfontaine/quasar-pnpm-workspace-bug

How to reproduce?

  1. Clone the repo. It was built using quasar create then adding electron mode.
  2. Run quasar build -m electron

Flavour

Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)

Areas

Electron Mode

Platforms/Browsers

Electron

Quasar info output

Relevant log output

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions