Skip to content

Make Next.js extra env file watchers non-persistent - #1237

Merged
theoephraim merged 1 commit into
mainfrom
fix-nextjs-nonpersistent-watchers
Oct 16, 2026
Merged

theoephraim merged 1 commit into
mainfrom
fix-nextjs-nonpersistent-watchers

Conversation

@theoephraim

Copy link
Copy Markdown
Member

Closes #1235.

enableExtraFileWatchers used persistent fs.watchFile watchers, so any process that loads the Next config in dev mode stayed alive forever. Since Next 16.0.3 the telemetry detached-flush helper relies on the event loop draining to exit, so every next dev stop left one orphaned process behind.

The watchers now pass persistent: false. The dev server stays alive through its HTTP server, so env reloading is unaffected.

@github-actions

Copy link
Copy Markdown
Contributor

bumpy-frog

The changes in this PR will be included in the next version bump.

patch Patch releases

  • @varlock/nextjs-integration 1.2.5 → 1.2.6

Bump files in this PR

Click here if you want to add another bump file to this PR


This comment is maintained by bumpy.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes across the extra env watcher setup, its regression assertion, and the package release entry.

  • Watcher lifetime: Extra env file polling uses persistent: false, allowing short-lived config-loading processes to exit without changing reload callbacks or polling frequency.
  • Regression coverage: The existing FIFO test checks that installed watchers are non-persistent.
  • Release entry: Records the process-lifetime fix for @varlock/nextjs-integration.

The integration build and all 57 unit tests passed. A Node subprocess using the built dev-mode loader exited naturally. Full Next.js server reload and telemetry-helper end-to-end scenarios were not run.

Pullfrog  | View workflow run | Using gpt-6.1-sol | 𝕏

@pkg-pr-new

pkg-pr-new Bot commented Oct 16, 2026

Copy link
Copy Markdown

Open in StackBlitz

varlock

npm i https://pkg.pr.new/varlock@1237

@varlock/nextjs-integration

npm i https://pkg.pr.new/@varlock/nextjs-integration@1237

@varlock/native-helper-darwin

npm i https://pkg.pr.new/@varlock/native-helper-darwin@1237

@varlock/native-helper-linux-arm64

npm i https://pkg.pr.new/@varlock/native-helper-linux-arm64@1237

@varlock/native-helper-linux-x64

npm i https://pkg.pr.new/@varlock/native-helper-linux-x64@1237

@varlock/native-helper-win32-x64

npm i https://pkg.pr.new/@varlock/native-helper-win32-x64@1237

commit: 478c0d6

@theoephraim
theoephraim merged commit 575a24e into main Oct 16, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: Next.js env file watchers keep Next's telemetry helper running forever after next dev stops

1 participant