Skip to content

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

Closed

Description

@Calemy

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

Activity

  1. eliliam commented on Sep 12, 2023

    @eliliam

    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.

  2. added
    bun.jsSomething to do with a Bun-specific API
    on Sep 12, 2023
  3. alancnet commented on Sep 18, 2023

    @alancnet

    Can confirm this is still happening on 1.0.2

  4. Electroid commented on Sep 20, 2023

    @Electroid
    Contributor

    Duplicate of #1446

  5. Tjerk-Haaye-Henricus commented on Sep 30, 2023

    @Tjerk-Haaye-Henricus

    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
  6. Japskua commented on Oct 13, 2023

    @Japskua

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

  7. Master-Y0da commented on Oct 28, 2023

    @Master-Y0da

    Same happening here...any workaround ?

  8. Jarred-Sumner commented on Sep 6, 2024

    @Jarred-Sumner
    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

  9. changed the title [-]Bad file descriptor on files that exist[/-] [+]Bad file descriptor on files that exist (`Bun.file(path)`)[/+] on Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingbun.jsSomething to do with a Bun-specific API

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions