oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
74.28k stars 2.77k forks source link

TypeError: process.binding("fs") is not supported in Bun #3546

Open nikitavoloboev opened 1 year ago

nikitavoloboev commented 1 year ago

What version of Bun is running?

0.6.14

What platform is your computer?

Darwin 22.5.0 arm64 arm

What steps can reproduce the bug?

bun i watcher

https://github.com/fabiospampinato/watcher

with this code

import Watcher from "watcher"

async function main() {
  const watcher = new Watcher("/foo/bar")
}

main().catch((err) => {
  console.error(err)
  process.exit(1)
})

Fails:

image
aguadeowo commented 1 year ago

please fix this

0xRapid commented 1 year ago

bump :)

gamedevsam commented 1 year ago

This is breaking the tar library for me, sadness as bun seems very fast (love the deep integration with TypeScript, no more node -r tsconfig-paths/register -r ts-node/register... eventually :)

F2AMv commented 1 year ago

also breaks the DydxClient/v3 library

RaekwonIII commented 12 months ago

Breaking up a small project of mine as well. It's so unfortunate, because I love how bun makes it so much easier to mix module imports and accept everything... 😫

Flouwrian commented 11 months ago

Also still not implemented in Bun 1.0 :(

shtengel commented 11 months ago

(Bun 1.0.14) Also breaks "web3" which imports "fs-minipass" any solution to this?

btakita commented 11 months ago

This breaks bun -b vercel dev

peacefulotter commented 10 months ago

Still having an issue in Bun v1.0.21

bun install v1.0.21 (837cbd60)
  🚚 bun-typesrflow/tfjs-node [1/1] 2 | const MiniPass = require('minipass')
3 | const EE = require('events').EventEmitter
4 | const fs = require('fs')
5 | 
6 | // for writev
7 | const binding = process.binding('fs')
                    ^
error: process.binding("fs") is not implemented in Bun. Track the status & thumbs up the issue: https://github.com/oven-sh/bun/issues/3546
      at .../node_modules/fs-minipass/index.js:7:17
      at .../node_modules/tar/lib/create.js:8:7
      at .../node_modules/tar/index.js:4:21
      at .../node_modules/@tensorflow/tfjs-node/scripts/resources.js:25:7
      at .../node_modules/@tensorflow/tfjs-node/scripts/install.js:37:7

error: install script from "@tensorflow/tfjs-node" exited with 1
jdalton commented 10 months ago

I'm making the error message for process.binding(...) a bit more descriptive (https://github.com/oven-sh/bun/pull/8286). The hope is that along with letting us know "it's not working" that there is also the name of the method/property being accessed. This will help us know which to tackle as the API surface area for all bindings is very large.

upsilon01 commented 9 months ago

Breakes 'fs-minipass' Bun version: 1.0.25

baptistecs commented 9 months ago

FYI

Bun version: 1.0.25

$ bun create react-ssr                                                                                                                                                                                                                            warn: incorrect peer dependency "react@18.2.0"
warn: incorrect peer dependency "react@18.2.0"
error: process.binding("fs") is not implemented in Bun. Track the status & thumbs up the issue: https://github.com/oven-sh/bun/issues/3546
      at /private/tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:68254
      at /private/tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:76017
      at /private/tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:56312
      at /private/tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:346540
      at /private/tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:346649
      at /private/tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:517868
      at /private/tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:523113
      at e (/private/tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:523995)
      at get (/private/tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:523911)
[1]    42708 segmentation fault  bun create react-ssr
0xdeployer commented 9 months ago

please fix

baptistecs commented 9 months ago

FYI

Bun version: 1.0.25

$ bun create react-ssr                                                                                                                                                                                                                            warn: incorrect peer dependency "react@18.2.0"
warn: incorrect peer dependency "react@18.2.0"
error: process.binding("fs") is not implemented in Bun. Track the status & thumbs up the issue: https://github.com/oven-sh/bun/issues/3546
      at /private/tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:68254
      at /private/tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:76017
      at /private/tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:56312
      at /private/tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:346540
      at /private/tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:346649
      at /private/tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:517868
      at /private/tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:523113
      at e (/private/tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:523995)
      at get (/private/tmp/create-react-ssr@latest--bunx/node_modules/esm/esm.js:1:523911)
[1]    42708 segmentation fault  bun create react-ssr

I had the same issue after running bun create preact and realized that Bun is using npm under the hood, which I didn't installed.

All good after installing NodeJS + npm.

Jarred-Sumner commented 9 months ago

~process.binding("fs") was implemented, which this issue covers~

~When you run into this with another native module, please open a specific issue for it so we can track it~

it was not implemented. I was confusing it for a different process.binding we implemented.

code-ishwar commented 8 months ago

Any ETA on this?

jvmusin commented 7 months ago

Sadly, can not use vercel via bundows because of this bug

Levisnkyyyy commented 6 months ago

2.782 7 | const binding = process.binding('fs') 2.782 ^ 2.782 error: process.binding("fs") is not implemented in Bun. Track the status & thumbs up the issue: https://github.com/oven-sh/bun/issues/3546 2.782 at /usr/application/node_modules/fs-minipass/index.js:7:17 2.782 at /usr/application/node_modules/tar/lib/create.js:8:7 2.782 at /usr/application/node_modules/tar/index.js:4:21 2.782 at /usr/application/node_modules/@tensorflow/tfjs-node/scripts/resources.js:25:7 2.782 at /usr/application/node_modules/@tensorflow/tfjs-node/scripts/install.js:37:7 2.782 2.782 error: install script from "@tensorflow/tfjs-node" exited with 1

With tensorflow as well

Wuemeli commented 6 months ago

eta?

ademlabs commented 5 months ago

Any idea when this PR https://github.com/Neo00007/bun/pull/5 would be merged for a canary build?

kaitlynia commented 4 months ago

cannot use Minipass without this

Wuemeli commented 4 months ago

When will this be fixed?

mccccccmike commented 4 months ago

hello same issue

codr1 commented 2 months ago

same same

Kay-79 commented 6 days ago

Same issue