rspack
rspack copied to clipboard
Starter examples in CLI not working as expected in windows
System Info
System: OS: Windows 11 10.0.22621 CPU: (4) x64 11th Gen Intel(R) Core(TM) i3-1115G4 @ 3.00GHz Memory: 1.13 GB / 7.73 GB Binaries: Node: 18.18.2 - ~\scoop\apps\nvm\current\nodejs\nodejs\node.EXE npm: 9.8.1 - ~\scoop\apps\nvm\current\nodejs\nodejs\npm.CMD pnpm: 7.9.0 - ~\AppData\Local\pnpm\pnpm.EXE Browsers: Edge: Chromium (119.0.2151.72) Internet Explorer: 11.0.22621.1 npmPackages: @rspack/cli: 0.4.0 => 0.4.0 @rspack/core: 0.4.0 => 0.4.0 @rspack/plugin-react-refresh: 0.4.0 => 0.4.0
Details
I used the cmd given in the docs to create a new rspack project pnpm create rspack@latest, everything worked perfectly until I ran pnpm dev
Here's the error I got -
The error arises because you can't set env vars like that on widows, the correct syntax for windows will be -
SET NODE_ENV=something
I changed the scripts in package.json to this and it worked as expected -
...
"scripts": {
"dev": "SET NODE_ENV=development && rspack serve",
"build": "SET NODE_ENV=production && rspack build"
},
...
Is there any way we can check for the os info before copying the package.json and make changes accordingly? I'm willing to help on this issue :)
Reproduce link
No response
Reproduce Steps
- Run
pnpm create rspack@latest - Choose any starter
- Run
pnpm dev
note: this is a windows specific issue
we need to use cross-env to set environment, @asrvd can you give it a try
sure, will update on this soon
we need to use cross-env to set environment, @asrvd can you give it a try
worked perfectly! will make a pr soon
thanks in advance
thanks in advance
just finished making the changes, wanted to run package specific tests but there are no scripts for the package ?
tried installing the deps so that I can run the cli manually, but getting this error again
It's still broken, how about use cross-env in starter-templates scripts ?
If you think it is useful, I can create a PR soon.
It's still broken, how about use
cross-envin starter-templates scripts ? If you think it is useful, I can create a PR soon.
thanks in advance
This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!
bump
This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!