You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(assets,nuxt): stop dev-bridge file-watcher leak that OOMs/hangs Nuxt
The assets plugin starts a chokidar watcher in setup(), but it was only
ever disposed by tests. A Nuxt/Vite host recreates the dev bridge — and a
fresh DevframeNodeContext — on every config reload and once per build
environment, so watchers accumulated until the dev process ran out of
heap ("JS heap out of memory" on Nuxt 4); the destabilised/killed bridge
then surfaced on the client as a WebSocket "socket hang up" (Nuxt 5).
- assets: key live watchers by absolute directory (not by context) so a
new setup on the same dir supersedes the previous watcher instead of
stacking another — capping watchers at one per directory regardless of
reload count. Regression test added.
- assets: harden the watch — followSymlinks:false, ignore node_modules/
.git/.nuxt/.output/.turbo/.cache/dist, ignorePermissionErrors, and a
bounded depth — so a symlink or misconfigured dir can't make the scan
walk a huge tree.
- nuxt: mount the dev RPC/WS bridge on the client build only
({ server: false }). The browser talks to Nuxt's client dev server, so
the second bridge + watcher spun up in the Nitro/SSR build context was
redundant and a source of instability.
Co-authored-by: opencode <noreply@opencode.ai>
0 commit comments