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

Error after stopping the dev server when run in an npm workspace #1459

Closed
nswanberg opened this issue Jun 13, 2024 · 1 comment · Fixed by #1460
Closed

Error after stopping the dev server when run in an npm workspace #1459

nswanberg opened this issue Jun 13, 2024 · 1 comment · Fixed by #1460
Assignees
Labels
bug Something isn’t working

Comments

@nswanberg
Copy link

It's a minor issue, but I see this error when stopping the Observable dev server when the Observable project is in an NPM workspace:

^Cnpm ERR! Lifecycle script `dev` failed with error: 
npm ERR! Error: command failed 
npm ERR!   in workspace: undefined 
npm ERR!   at location: /Users/nate/belle/github/test-workspace/projects/another-framework 
# Create workspace directory
mkdir test-workspace
cd test-workspace

# Initialize npm workspace
echo '{
  "name": "test-workspace",
  "version": "1.0.0",
  "private": true,
  "workspaces": [
    "projects/*"
  ]
}' > package.json

# Create Observable project directory
mkdir -p projects/my-observable-project
cd projects

# Create an Observable project with defaults (the error also happens with an empty Observable project)
npm init @observablehq

# ... answer setup questions ...

cd ./hello-framework

# Run observable
npm run dev

# Hit CTRL-c to quit and see the error above
@nswanberg nswanberg added the bug Something isn’t working label Jun 13, 2024
@mbostock
Copy link
Member

I’m able to reproduce, and I’ve confirmed that this is caused by the signal handling added for telemetry:

framework/src/telemetry.ts

Lines 100 to 102 in 1b71e52

process.on("SIGHUP", this.handleSignal(1));
process.on("SIGINT", this.handleSignal(2));
process.on("SIGTERM", this.handleSignal(15));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn’t working
2 participants