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: process.binding("fs") is not supported in Bun #3546

Open
nikitavoloboev opened this issue Jul 6, 2023 · 24 comments · May be fixed by Neo00007/bun#5
Open

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

nikitavoloboev opened this issue Jul 6, 2023 · 24 comments · May be fixed by Neo00007/bun#5
Labels
bug Something isn't working node.js Compatibility with Node.js APIs

Comments

@nikitavoloboev
Copy link

nikitavoloboev commented Jul 6, 2023

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
@nikitavoloboev nikitavoloboev added the bug Something isn't working label Jul 6, 2023
@robobun robobun added the node.js Compatibility with Node.js APIs label Jul 7, 2023
@aguadeowo
Copy link

please fix this

@0xRapid
Copy link

0xRapid commented Oct 3, 2023

bump :)

@gamedevsam
Copy link
Contributor

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
Copy link

F2AMv commented Nov 13, 2023

also breaks the DydxClient/v3 library

@RaekwonIII
Copy link

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
Copy link

Also still not implemented in Bun 1.0 :(

@shtengel
Copy link

shtengel commented Nov 26, 2023

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

@btakita
Copy link

btakita commented Nov 30, 2023

This breaks bun -b vercel dev

@peacefulotter
Copy link

peacefulotter commented Jan 9, 2024

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
Copy link
Contributor

jdalton commented Jan 19, 2024

I'm making the error message for process.binding(...) a bit more descriptive (#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
Copy link

Breakes 'fs-minipass'
Bun version: 1.0.25

@baptistecs
Copy link

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
Copy link

please fix

@baptistecs
Copy link

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
Copy link
Collaborator

Jarred-Sumner commented Feb 5, 2024

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
Copy link

Any ETA on this?

@paperdave paperdave changed the title TypeError: process.binding() is not supported in Bun TypeError: process.binding("fs") is not supported in Bun Apr 1, 2024
@jvmusin
Copy link

jvmusin commented Apr 4, 2024

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

@Levisnkyyyy
Copy link

Levisnkyyyy commented Apr 29, 2024

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
Copy link

Wuemeli commented May 4, 2024

eta?

@ademlabs
Copy link

Any idea when this PR Neo00007#5 would be merged for a canary build?

@kaitlynia
Copy link

cannot use Minipass without this

@Wuemeli
Copy link

Wuemeli commented Jul 17, 2024

When will this be fixed?

@mccccccmike
Copy link

hello same issue

@codr1
Copy link

codr1 commented Sep 13, 2024

same same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working node.js Compatibility with Node.js APIs
Projects
None yet
Development

Successfully merging a pull request may close this issue.