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

Watch process doesn’t successfully close (3.0.0-alpha.17) #3375

Closed
paulrobertlloyd opened this issue Jul 22, 2024 · 1 comment
Closed

Watch process doesn’t successfully close (3.0.0-alpha.17) #3375

paulrobertlloyd opened this issue Jul 22, 2024 · 1 comment
Labels
release: canary A release on the canary channel

Comments

@paulrobertlloyd
Copy link
Contributor

paulrobertlloyd commented Jul 22, 2024

Operating system

macOS Sonoma 14.5

Eleventy

3.0.0-alpha.17

Describe the bug

Since 3.0.0-alpha.17, its not possible to stop the Eleventy process midway through a build, instead it either:

  • appears to close (returned to the terminal prompt) but then new output messages are shown in terminal
  • closes but throws an error

The result is that, as I develop locally, and start/stop builds, I’m ending up with many processes running (such that just testing this again now I’m serving my site from port 8087)

It would appear that this.watcher is undefined in

await this.watcher?.close();

Which is odd as this call uses optional chaining.

Likely related to the change in #3361

Reproduction steps

Error shown after stopping a process mid build:

Original error stack trace: TypeError: Cannot read properties of undefined (reading 'close')
     at Eleventy.stopWatch (file:///Users/paulrobertlloyd/Sites/paulrobertlloyd-v4/node_modules/@11ty/eleventy/src/Eleventy.js:1196:22)
     at async process.<anonymous> (/Users/paulrobertlloyd/Sites/paulrobertlloyd-v4/node_modules/@11ty/eleventy/cmd.cjs:120:9)

Expected behavior

Previous behaviour; felt much more robust than it does currently.

@zachleat zachleat added this to the Eleventy 3.0.0 milestone Jul 22, 2024
@zachleat zachleat added release: canary A release on the canary channel and removed needs-triage labels Jul 22, 2024
@zachleat
Copy link
Member

Yeah, await this.watcher?.close(); was added 4 days ago, after 3.0.0-alpha.17. It’ll roll with 3.0.0-alpha.18: 6f36fe8

zachleat added a commit that referenced this issue Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release: canary A release on the canary channel
Projects
None yet
Development

No branches or pull requests

2 participants