bun icon indicating copy to clipboard operation
bun copied to clipboard

Please make it working : node-fs.

Open tahonaPL opened this issue 2 years 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

error: Cannot find package "dgram" from "bun:wrap" still occurs even with version 0.3.0. I am trying to use the node module, mongoose.

TechFun4 avatar Dec 09 '22 19:12 TechFun4

Getting error: Cannot find package "dgram" from "bun:wrap" whene trying to use ioredis module. Bun v0.3.0

mia-z avatar Dec 19 '22 11:12 mia-z

Will make a separate issue for tracking dgram, as that is unrelated to the package in this issue

Jarred-Sumner avatar Dec 19 '22 17:12 Jarred-Sumner