Open jldec opened 2 months ago
Is this issue still unreviewed? :(
Looking at the code in question it seems it would need to call .ref() on that return line https://github.com/denoland/deno/blob/main/ext/node/polyfills/_fs/_fs_watch.ts#L155, but it would be returning an async iterator for a Deno.FsEvent instead of a node one which has different property names.
I have also encountered this, and it seems that the watch
in question was promisified instead of being an AsyncIterator
like node:fs/promises
.
await watch(path)
does not fulfill the promise.
Version: Deno 1.42.4
The deno polyfill for
node fsPromises.watch()
does not appear to return anAsyncIterator
as documented here for node.With deno run, using the returned watcher with
for await
throwsTypeError: watcher is not async iterable
. The same code works with node.repro
fswatch-node.js from: https://github.com/jldec/deno-node-fs-promises-watch
Ref: https://github.com/denoland/deno/blob/main/ext/node/polyfills/_fs/_fs_watch.ts#L126C5-L126C18