lerna / lerna/lerna

Running multiple vite development servers with useNx=true cannot be killed

Open
#3,824 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: bug
Dominant language
TypeScript
Stars
36.1k
Forks
2.3k
Avg merge
1d 4h
Merged PRs (30d)
50

Description

Current Behavior

Before updating from lerna 6.4.1 to 7.2.0 everything was running as expected. Now, when I kill my running development servers (started using vite) the processes are not killed cleanly but can still be seen in the task manager and the bash is stale. As soon as I set useNx=false in the lerna.json everything works like before.

See "Steps to Reproduce" for my current setup.

Please note that setting useNx=false is ok for me now, but I fear that the old behavior might vanish some day and I have to cope with the bug once more. Additionally, by submitting this bug report I hope to be able to help you make your implementation more stable. If you need any further information, just ask.

Expected Behavior

If I hit ctrl+c in the bash session where lerna is running, the process should get killed cleanly and the bash session should be reusable.

Steps to Reproduce

I just use plain lerna without nx and thus have no nx.json.

In my root package.json I have the following script that I am running by npm run start:

 "start": "lerna run start --stream --parallel --ignore some-legacy-app"

Each application has scripts like these:

"dev": "vite --host",
"start": "npm run dev",

vite has version 4.0.4, and lerna 7.2.0

Failure Logs / Configuration
lerna.json

{
  "$schema": "node_modules/lerna/schemas/lerna-schema.json",
  "packages": [
    "applications/*",
    "libraries/*",
    "templates/*"
  ],
  "version": "4.0.3",
  "npmClient": "npm",
  "npmClientArgs": [
    "--legacy-peer-deps"
  ],
  "useNx": true
}

lerna-debug.log

- none available -

Environment
$ npx lerna info
lerna notice cli v7.2.0

 Environment info:

  System:
    OS: Windows 10 10.0.22621
    CPU: (24) x64 12th Gen Intel(R) Core(TM) i7-12800HX
  Binaries:
    Node: 18.17.1 - ~\.nvm\versions\node\v18.17.1\bin\node.EXE
    npm: 9.6.7 - ~\.nvm\versions\node\v18.17.1\bin\npm.CMD
  Utilities:
    Git: 2.42.0. - /mingw64/bin/git
  npmPackages:
    lerna: ^7.1.5 => 7.2.0 

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue on Windows 10 using the root npm run start script, lerna run start --stream --parallel, Vite's dev scripts, and the lerna.json useNx setting. Compare Ctrl+C behavior with useNx=true and useNx=false; done means all development-server processes exit and the bash session is reusable.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vite
Domain
build-system, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.