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

rspack v0.3.4 cannot be started in mono-repo when using workspaces in package.json #4203

Closed
erikvullings opened this issue Sep 16, 2023 · 2 comments
Labels
bug Something isn't working need more info need reproduction pending triage The issue/PR is currently untouched.

Comments

@erikvullings
Copy link

System Info

System:
OS: Linux 5.15 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
CPU: (7) x64 Intel(R) Core(TM) i7-10850H CPU @ 2.70GHz
Memory: 11.45 GB / 19.54 GB
Container: Yes
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 16.20.2 - /usr/bin/node
Yarn: 1.22.19 - /usr/bin/yarn
npm: 8.19.4 - /usr/bin/npm
pnpm: 8.7.5 - ~/dev/cat/node_modules/.bin/pnpm
Browsers:
Chrome: 107.0.5304.87

Details

I've used rspack in a number of projects with impressive results, and I really like it. However, when installing it with pnpm in a simple mono-repo to build my GUI in packages/gui, a simple command like npx rspack --version failed:

npm ERR! could not determine executable to run
npm ERR! A complete log of this run can be found in:
npm ERR!     /home/erik/.npm/_logs/2023-09-16T15_36_22_686Z-debug-0.log

The root cause, I assume, is that my root package.json contains a "workspaces": ["packages/*"]. Without it, it runs just fine.

Reproduce link

No response

Reproduce Steps

  1. mkdir -p tmp/packages/gui
  2. cd tmp
  3. npm init -y
  4. edit package.json and add "workspaces": [ "packages/*" ],
  5. cd packages/gui
  6. npm init -y
  7. pnpm i -D @rspack/cli
  8. npx rspack --version

Root package.json with the offending workspaces.

{
  "name": "tmp",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "workspaces": [
    "packages/*"
  ]
}
@erikvullings erikvullings added bug Something isn't working pending triage The issue/PR is currently untouched. labels Sep 16, 2023
@hardfist
Copy link
Contributor

@erikvullings this seems not a rspack bug but package manage bug, and I following your steps here and everything works fine
image
maybe you can help provide a repro demo so we can investigate futher

@erikvullings
Copy link
Author

erikvullings commented Sep 17, 2023

Thanks for the quick reply, and indeed, you are right: it is a pnpm issue. I've created a test repo git clone https://github.com/erikvullings/rspack-test.git, and when using pnpm i to install all dependencies, it fails to run npx rspack --version. Using npm i works, however, as well as bun i.

Interestingly, I tried to run the same test on Ubuntu (not in WSL2), using the same v8.7.5 of pnpm, and it warned me that the workspaces property is not supported in pnpm (which it did not in WSL2). So I will close the issue here and raise it there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need more info need reproduction pending triage The issue/PR is currently untouched.
Projects
None yet
Development

No branches or pull requests

2 participants