Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot define property Symbol(graceful-fs.queue), object is not extensible #245

Open
niieani opened this issue Feb 7, 2024 · 1 comment

Comments

@niieani
Copy link

niieani commented Feb 7, 2024

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:

function publishQueue(context, queue) {
Object.defineProperty(context, gracefulQueue, {
get: function() {
return queue
}
})
}

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.

@xmedeko
Copy link

xmedeko commented Apr 4, 2024

Maybe use WeakMap (and drop support for very old version of Node)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants