Skip to content

w4 watch bug with node 18 fs.watch #824

@Tomcat-42

Description

@Tomcat-42

There is and old and already resolved issue on node about fs.watch crashing on linux when deleting files: nodejs/node#52018.

That bug happened to me in my zig game, because zig deletes and creates a lot of files in .zig-cache.

[I] ~/d/g/w/hw (main|✚1) • w4 watch
Building with: zig build
node:internal/fs/watchers:252
    throw error;
    ^

Error: ENOENT: no such file or directory, watch '.zig-cache/tmp/d51c962b31cecc5d'
    at FSWatcher.<computed> (node:internal/fs/watchers:244:19)
    at Object.watch (node:fs:2315:34)
    at /snapshot/cli/node_modules/node-watch/lib/watch.js:397:22
    at hasNativeRecursive (/snapshot/cli/node_modules/node-watch/lib/has-native-recursive.js:61:12)
    at Watcher.watchDirectory (/snapshot/cli/node_modules/node-watch/lib/watch.js:380:3)
    at /snapshot/cli/node_modules/node-watch/lib/watch.js:304:20
    at hasNativeRecursive (/snapshot/cli/node_modules/node-watch/lib/has-native-recursive.js:61:12)
    at FSWatcher.internalOnChange (/snapshot/cli/node_modules/node-watch/lib/watch.js:290:7)
    at FSWatcher.emit (node:events:537:28)
    at FSWatcher._handle.onchange (node:internal/fs/watchers:212:12) {
  errno: -2,
  syscall: 'watch',
  code: 'ENOENT',
  path: '.zig-cache/tmp/d51c962b31cecc5d',
  filename: '.zig-cache/tmp/d51c962b31cecc5d'
}

Don't know if it happens in other langs templates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions