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

nr dev scripts do not run concurrently on Windows #284

Closed
5 tasks done
janfrl opened this issue Oct 13, 2023 · 5 comments · Fixed by #287
Closed
5 tasks done

nr dev scripts do not run concurrently on Windows #284

janfrl opened this issue Oct 13, 2023 · 5 comments · Fixed by #287

Comments

@janfrl
Copy link
Contributor

janfrl commented Oct 13, 2023

Describe the bug

nr dev runs tsup in watch mode and eslint-flat-config-viewer. Both commands run indefinitely and therefore need to be executed concurrently. I assume that this is achieved by the & sign on Unix-based systems, however on my Windows system only the first command is executed.

There are multiple tools which can be used to run these scripts concurrently, namely npm-run-all and concurrently. I don't have a preference here but settled with npm-run-all for my own fork (0bb5146) because the command looked slightly cleaner.

I haven't created a PR yet because #277 changes the npm scripts and this would cause a merge conflict. But I would be happy to create one once this is merged if you agree to use either npm-run-all or concurrently.

Reproduction

Here is a copy of the repo at the time this issue exists, I don't think this need to be more minimal: https://github.com/zanfee/eslint-config/tree/bug/nr-dev-windows

System Info

System:
  OS: Windows 10 10.0.22621
  CPU: (12) x64 AMD Ryzen 5 7600 6-Core Processor
  Memory: 16.56 GB / 31.16 GB
Binaries:
  Node: 18.17.1 - C:\Program Files\nodejs\node.EXE
  npm: 9.7.2 - C:\Program Files\nodejs\npm.CMD
  pnpm: 8.9.0 - ~\AppData\Local\pnpm\pnpm.CMD
Browsers:
  Edge: Chromium (117.0.2045.60)
  Internet Explorer: 11.0.22621.1

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
@antfu
Copy link
Owner

antfu commented Oct 13, 2023

I wonder if this would work https://petermekhaeil.com/til/pnpm-shell-emulator/ ?

@janfrl
Copy link
Contributor Author

janfrl commented Oct 13, 2023

Good idea, the scripts seem to work just fine with shell-emulator. However when stopping it with ctrl + c, the terminal seems to crash and does not respond anymore. I will investigate this further later.

@janfrl
Copy link
Contributor Author

janfrl commented Oct 17, 2023

Good idea, the scripts seem to work just fine with shell-emulator. However when stopping it with ctrl + c, the terminal seems to crash and does not respond anymore. I will investigate this further later.

This problem did not occur on my laptop. I will do more testing/research in the coming days.

System:
  OS: Windows 10 10.0.22621
  CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
  Memory: 1.75 GB / 15.73 GB
Binaries:
  Node: 18.18.0 - C:\Program Files\nodejs\node.EXE
  npm: 10.2.0 - C:\Program Files\nodejs\npm.CMD
  pnpm: 8.9.0 - ~\AppData\Local\pnpm\pnpm.EXE
Browsers:
  Edge: Spartan (44.22621.2283.0), Chromium (117.0.2045.60), ChromiumDev (119.0.2151.2)
  Internet Explorer: 11.0.22621.1

janfrl added a commit to janfrl/eslint-config that referenced this issue Oct 17, 2023
`nr dev` runs tsup in watch mode and eslint-flat-config-viewer. Both commands run indefinitely and therefore need to be executed concurrently. I assume that this is achieved by the & sign on Unix-based systems, however on my Windows system only the first command is executed.

This is fixed by enabling shell-emulator as suggested in antfu#284 by @antfu.
@janfrl
Copy link
Contributor Author

janfrl commented Oct 22, 2023

On the system I mentioned in my first post (#284 (comment)) this problem occurs in Git Bash and in Windows CMD but not in WSL. When I stop the terminal command, the tsup command doesn't properly end (I'm not sure if this is related to tsup though, only noticed that eslint-viewer is unreachable immediately after terminating it).

Sometimes the terminal will freeze completely, sometimes I can still enter things but it wont do anything (until tsup actually stops, like you can see in the screenshot).

image

@antfu
Copy link
Owner

antfu commented Oct 23, 2023

Merged #287 for now to move forward. I am not sure if the other issue you mentioned is related to this project or not (looks more like a WSL/setup issue to me). If any other thing we could do on our side, feel free to bring this back. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants