bun icon indicating copy to clipboard operation
bun copied to clipboard

Please make it working : node-fs.

Open tahonaPL opened this issue 1 year ago • 5 comments

What is the problem this feature will solve?

Great this is amazing project. But there is a problem with most basic components: node-fs. Is there alternative that will work?

this is mandatory to make switch from node js to bum.

What is the feature you are proposing to solve the problem?

69 | * Polymorphic approach to fs.mkdir() 70 | * 71 | * If the third parameter is boolean and true assume that 72 | * caller wants recursive operation. 73 | */ 74 | fs.mkdir = function (path, mode, recursive, callback) { ^ TypeError: Attempted to assign to readonly property. at ...../node_modules/node-fs/lib/fs.js:74:2

What alternatives have you considered?

or please create feature that can replace node-fs api.

tahonaPL avatar Jul 16 '22 20:07 tahonaPL

The bug here is that fs is marked as readonly when it should not be

Jarred-Sumner avatar Jul 16 '22 22:07 Jarred-Sumner

What about this error:

error: Cannot find package "dgram" from "bun:wrap"

tahonaPL avatar Jul 16 '22 22:07 tahonaPL

The bug here is that fs is marked as readonly when it should not be

For now you can fix it by adding fs = Object.assign({}, fs) to the module

^ for modules that expands fs

xHyroM avatar Jul 17 '22 05:07 xHyroM

The bug here is that fs is marked as readonly when it should not be

For now you can fix it by adding fs = Object.assign({}, fs) to the module

You mean to ??

import { MongoClient } from "mongodb";

tahonaPL avatar Jul 17 '22 06:07 tahonaPL

The same error occurs for other built in node.js modules, like module. That's also read-only:

afbeelding

skerit avatar Aug 25 '22 19:08 skerit

This should've been fixed some time ago. Please comment if you run into it again

Jarred-Sumner avatar Oct 10 '22 20:10 Jarred-Sumner