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

Bad file descriptor on files that exist (Bun.file(path)) #4798

Closed
Calemy opened this issue Sep 10, 2023 · 7 comments · Fixed by #7470
Closed

Bad file descriptor on files that exist (Bun.file(path)) #4798

Calemy opened this issue Sep 10, 2023 · 7 comments · Fixed by #7470
Labels
bug Something isn't working bun.js Something to do with a Bun-specific API

Comments

@Calemy
Copy link

Calemy commented Sep 10, 2023

What version of Bun is running?

1.0.0+822a00c4d508b54f650933a73ca5f4a3af9a7983

What platform is your computer?

Linux 5.4.0-155-generic x86_64 x86_64

What steps can reproduce the bug?

const file = await Bun.file("/home/lemres/mino-bun/here.txt")
console.log(file.type)
await file.text()
console.log(file)

this results me in an bad file descriptor error even though the file exists.

What is the expected behavior?

be able to get a string out of the text file

What do you see instead?

grafik
grafik

Additional information

No response

@Calemy Calemy added the bug Something isn't working label Sep 10, 2023
@eliliam
Copy link

eliliam commented Sep 12, 2023

I can confirm this issue exists too. It appears to work perfectly fine on a Mac OS with Apple Silicon(arm64) but fails with your same error when running on an x86_64 Linux machine.

@Electroid Electroid added the bun.js Something to do with a Bun-specific API label Sep 12, 2023
@alancnet
Copy link

Can confirm this is still happening on 1.0.2

@Electroid
Copy link
Contributor

Duplicate of #1446

@Electroid Electroid marked this as a duplicate of #1446 Sep 20, 2023
@Electroid Electroid closed this as not planned Won't fix, can't repro, duplicate, stale Sep 20, 2023
@Tjerk-Haaye-Henricus
Copy link

Tjerk-Haaye-Henricus commented Sep 30, 2023

I don't exactly know if the duplicate is really a duplicate btw.
So i'll add the same i've added there here.

Its happening on a remix app that uses tailwind too.

image

@Japskua
Copy link

Japskua commented Oct 13, 2023

Yes, still happening as well. Using bun 1.0.6 and running with Docker.

@Master-Y0da
Copy link

Same happening here...any workaround ?

@Jarred-Sumner
Copy link
Collaborator

I don't exactly know if the duplicate is really a duplicate btw. So i'll add the same i've added there here.

This issue was about the Bun.file(paht).* APIs, but that looks likely to be in node:fs

@Jarred-Sumner Jarred-Sumner changed the title Bad file descriptor on files that exist Bad file descriptor on files that exist (Bun.file(path)) Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working bun.js Something to do with a Bun-specific API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants