Open niieani opened 8 months ago
When used in an ESM context, node:fs module is not extensible. graceful-fs tries to define a Symbol property on the fs namespace here:
node:fs
graceful-fs
fs
https://github.com/isaacs/node-graceful-fs/blob/234379906b7d2f4c9cfeb412d2516f42b0fb4953/graceful-fs.js#L24-L30
This causes a TypeError:
Object.defineProperty(context, gracefulQueue, { ^ TypeError: Cannot define property Symbol(graceful-fs.queue), object is not extensible
Would be best if the check were to be implemented differently, rather than defining a property on node's fs module.
Maybe use WeakMap (and drop support for very old version of Node)?
WeakMap
When used in an ESM context,
node:fs
module is not extensible.graceful-fs
tries to define a Symbol property on thefs
namespace here:https://github.com/isaacs/node-graceful-fs/blob/234379906b7d2f4c9cfeb412d2516f42b0fb4953/graceful-fs.js#L24-L30
This causes a TypeError:
Would be best if the check were to be implemented differently, rather than defining a property on node's fs module.