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

Unexpected reading file error when working with Bun.build + --hot #11123

Open
levii-pires opened this issue May 16, 2024 · 7 comments
Open

Unexpected reading file error when working with Bun.build + --hot #11123

levii-pires opened this issue May 16, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@levii-pires
Copy link

What version of Bun is running?

1.1.8+89d25807f

What platform is your computer?

Linux 6.8.9-arch1-2 x86_64 unknown

What steps can reproduce the bug?

$ git clone https://github.com/levii-pires/bunsai2
$ cd bunsai2
$ bun install
$ cd examples
$ bun install
$ bun hono:hot

Then you go to bunsai2/examples/src/svelte/test.svelte, make some change and save the file

What is the expected behavior?

Nothing different than the first run

What do you see instead?

After triggering the first reload

Unexpected reading file: "/home/ti/Projs/bunsai2/src/extra/asset.ts"
    at /home/ti/Projs/bunsai2/src/extra/asset.ts

Additional information

No response

@levii-pires levii-pires added the bug Something isn't working label May 16, 2024
@aralroca
Copy link
Contributor

aralroca commented Jun 2, 2024

Same problem in Bun v1.1.12! Files exist, however, it's displaying this error after the hotreloading twice 😓

{
  outputs: [],
  success: false,
  logs: [
    error: Unexpected reading file: "/Users/aralroca/Documents/test/src/components/theme-slots.tsx"
 ]

The first time hot reloading works well, but in the second one, it fails.

@levii-pires did you found some workaround to fix it?

My current versions:

version: "v22.2.0",
 versions: {
   node: "22.2.0",
   bun: "1.1.12",
   webkit: "a780bdf0255ae1a7ed15e4b3f31c14af705facae",
   boringssl: "b275c5ce1c88bc06f5a967026d3c0ce1df2be815",
   openssl: "1.1.0",
   libarchive: "dc321febde83dd0f31158e1be61a7aedda65e7a2",
   mimalloc: "7968d4285043401bb36573374710d47a4081a063",
   picohttpparser: "066d2b1e9ab820703db0837a7255d92d30f0c9f5",
   uwebsockets: "43f0913c3875cbf260c60868268adc5953b09a80",
   zig: "0.12.0-dev.1828+225fe6ddb",
   zlib: "885674026394870b7e7a05b7bf1ec5eb7bd8a9c0",
   tinycc: "2d3ad9e0d32194ad7fd867b66ebe218dcc8cb5cd",
   lolhtml: "8d4c273ded322193d017042d1f48df2766b0f88b",
   ares: "0e7a5dee0fbb04080750cf6eabbe89d8bae87faa",
   usockets: "43f0913c3875cbf260c60868268adc5953b09a80",
   v8: "11.3.244.8-node.15",
   uv: "1.46.0",
   napi: "9",
   icu: "74.1",
   unicode: "15.1",
   modules: "115",
 },

@levii-pires
Copy link
Author

@aralroca the problems seems to rise when bun tries to read-and-bundle a file that is also being watched by bun.

yet no workaround...

@levii-pires
Copy link
Author

@paperdave

@aralroca
Copy link
Contributor

aralroca commented Jun 7, 2024

@levii-pires It also happens to me using import { watch } from “node:fs”; without the --hot, it also happens 🤔

@levii-pires
Copy link
Author

@aralroca so its a watch() bug

@levii-pires
Copy link
Author

@aralroca The cool thing is that it is a Linux bug. Not happening on Windows

@aralroca
Copy link
Contributor

aralroca commented Jun 7, 2024

@aralroca The cool thing is that it is a Linux bug. Not happening on Windows

It happens also in Mac

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

No branches or pull requests

2 participants