fix(pv-scripts): pin fork-ts-checker to 9.0.3 (fix macOS EMFILE)#250
Merged
Conversation
fork-ts-checker-webpack-plugin@9.1.0 bumped chokidar 3 -> 4, and chokidar 4 dropped fsevents. On macOS the TS type-check watcher then falls back to native fs.watch (one descriptor per directory) instead of a single fsevents stream, so watching a large tree (e.g. a tsconfig without `include`, which watches the project root incl. node_modules) crashes `pv-scripts dev` with `EMFILE: too many open files, watch`. Pin to 9.0.3, the last release on chokidar 3 (fsevents). The only difference between 9.0.3 and 9.1.0 is the chokidar major bump plus a cosmetic log string; the watch code is byte-identical, so this is a no-risk, transparent fix for all consumers. Verified on macOS against a real consumer: dev server stable, open FDs drop from ~9.9k (EMFILE crash) to ~22 via fsevents, type-check intact. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On macOS
pv-scripts devcrashes withEMFILE: too many open files, watchas soon as a page compiling several (lazy) bundles is opened, when the TS type-check is enabled. Regression introduced in pv-scripts 6 (fine in 5.0.1).Root cause
fork-ts-checker-webpack-plugin@9.1.0bumped itschokidardependency 3 → 4.chokidar@4droppedfsevents. On macOS it therefore falls back to nativefs.watch, which opens one file descriptor per watched directory instead of a singlefseventsstream.chokidar.watch(). Atsconfig.jsonwithoutincludemakes TypeScript watch the whole project root incl.node_modules, so the FD count explodes and exhausts the per-process limit.The regression is specific to 9.1.0 — versions 9.0.0–9.0.3 use
chokidar@^3.5.3(with fsevents).Fix
Pin
fork-ts-checker-webpack-pluginto9.0.3(last release on the chokidar-3 line). The entire diff9.0.3 → 9.1.0is: the chokidar major bump, a version string, and one cosmetic log message — the watch code is byte-identical. So this is a no-risk, transparent fix shipped to all consumers (no consumer-sideoverridesrequired).Also documents
enableTypeCheck(was missing from the config table) and adds a Troubleshooting section (tsconfiginclude,overrides,enableTypeCheck: false).Verification (macOS, real consumer)
pv-scripts dev+ open the crashing styleguide URLTS2322, passes clean code🤖 Generated with Claude Code