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

Compatibility issue with Node.js 23.0.0: TypeError in @nodelib/fs.scandir #110

Closed
demonicattack opened this issue Oct 19, 2024 · 4 comments

Comments

@demonicattack
Copy link

I encountered a compatibility issue with @nodelib/fs.scandir when using Node.js version 23.0.0. The error occurs due to an attempt to set a property on a Dirent object, which has only a getter.

22

Ubuntu 24.04
Node.js 23.0.0
@nodelib/fs.scandir 3.0.0

demonicattack added a commit to demonicattack/nodelib that referenced this issue Oct 19, 2024
@demonicattack
Copy link
Author

nodejs 23.1.0

image

@paschun
Copy link

paschun commented Nov 1, 2024

Looks like it'll be resolved next release

nodejs/node#55538

@paschun
Copy link

paschun commented Nov 1, 2024

It throws on bun too though.
Seems modifying fs.Dirent is deprecated
Can be patched to work on both runtimes with

Object.defineProperty(DirentFromStats.prototype, name, { get(){ return this[kStats][name]() }})

@mrmlnc
Copy link
Contributor

mrmlnc commented Nov 17, 2024

This issue was fixed in the node@23.2 (nodejs/node#55538).

@mrmlnc mrmlnc closed this as completed Nov 17, 2024
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

3 participants