Open
Description
What version of Bun is running?
1.0.1+31aec4ebe325982fc0ef27498984b0ad9969162b
What platform is your computer?
WSL Ubuntu 20.04 Over Microsoft Windows NT 10.0.22621.0 x64
What steps can reproduce the bug?
- install express & types
bun install express
bun install -d @type/express
- Copy the below snippet code to
index.ts
import express from 'express';
const app = express();
app.get('*', (req, res) => res.json({healthCheck: 'OKZ'}))
app.listen(8080, () => console.info('Server listening to 8080'))
- run the app using
hot
orwatch
[bun --watch index.ts
orbun --hot index.ts
] - Hit localhost:8080 and you should receive OKZ as a response
- While the server is running, replace
OKZ
withOKAYZ
- Hit the endpoint back and you will receive OKZ again
What is the expected behavior?
While the server is running using --watch
or --hot
it should perform hot reload for the application, so instead of receiving OKZ in step #6 instead it should return OKAYZ
What do you see instead?
While the server is running using --watch
or --hot
I keep receiving the initial server build
Additional information
There is an open thread on discord, link
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
a4amado commentedon Sep 13, 2023
Same error here, I faced the same error with WSL, I installed Ubuntu and still face the same error.
angelhdzmultimedia commentedon Sep 13, 2023
Same issue here since yesterday. I thought I was doing something wrong. Ubuntu WSL.
Also having other issues with Hono and Elysia and the request body...
SyntaxError: Unexpected end of JSON input
... also reported.Edit: Solved this in a later reply. Also solved the Elysia/Hono issue, I was using a
GET
request of course the body is not valid!riley-git commentedon Sep 14, 2023
If your project is located in the windows file system and you're accessing them through
/mnt
with WSL, hot reload will not work. See here.Moving my project and working within Linux environment allowed me to use
--hot
.angelhdzmultimedia commentedon Sep 14, 2023
Thank you! Solved for me.
Anyone knows how to open a VSCode window on Windows but using the linux file system with WSL?
I managed to move my bun project from windows file system to linux file system and now --watch/--hot work,
but I lose all my VSCode extensions because it's using a linux version of VSCode...
Edit: Nevermind. All extensions are installed. What I lost was the shortcuts to them on the left sidebar.
Edit 2: To anyone that needs this tip, to open VSCode in the linux file system with WSL:

Install these extensions:
And then:

Code_41bjxjKyP5.mp4
Edit 3: Got my extensions working. I had to browse the extensions I use, and then I get a hint besides the extensions name "install in WSL". Some extensions need this.
angelhdzmultimedia commentedon Sep 16, 2023
I'm not the Issue's author. Thank you.
Lekato98 commentedon Sep 16, 2023
angelhdzmultimedia commentedon Sep 19, 2023
angelhdzmultimedia commentedon Sep 19, 2023
Yor-dan commentedon Sep 19, 2023
thank you for your reply, I was confused by the docs where they show the browser reload side by side comparison with nodemon in Watch Mode > --hot mode section.
exactly like what you did mention, I am currently learning svelte which also has hot reload, and I am just so used to it that I even expect backed code to reflect hot reload in the browser without send a new request 😂
jakeg commentedon Nov 22, 2023
Can confirm both
--hot
and--watch
don't work in WSL on files from Windows' file system. It never reloads. It would be good if Bun at least showed a message to say it doesn't work.AJR07 commentedon May 31, 2024
Just want to resurface this issue of not being able to
--hot
and--watch
on WSL, would be great if a fix or a notice can be implemented.max-programming commentedon Mar 1, 2025
Hey but what is the solution if you want to keep it under the windows file system? I have a backend app that I want to run with WSL and it is nested inside a frontend app that I run in Windows normally