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

Cannot watch files in /mnt directory on WSL #4335

Closed
reserved-word opened this issue Aug 25, 2023 · 6 comments
Closed

Cannot watch files in /mnt directory on WSL #4335

reserved-word opened this issue Aug 25, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@reserved-word
Copy link

What version of Bun is running?

0.8.1+16b4bf341acc0f4804f0b6bdf5298c180cd00366

What platform is your computer?

Microsoft Windows NT 10.0.22621.0 x64

What steps can reproduce the bug?

  1. Create index.ts file in /mnt/c/Users/User/something/ directory
  2. cd /mnt/c/Users/User/something/ (in WSL console)
  3. bun run --watch index.ts (in WSL console)
  4. Modify index.ts (change console.log text or something)

What is the expected behavior?

index.ts restarted

What do you see instead?

Nothing happened

Additional information

No response

@reserved-word reserved-word added the bug Something isn't working label Aug 25, 2023
@infrahead
Copy link

The issue is that the Plan 9 server in WSL 2 does not support file watching on Windows files. The workaround is to place your files into the Linux file system (plus you'll get a performance boost).

see microsoft/WSL#4739

@ravinsharma7
Copy link

ravinsharma7 commented Sep 11, 2023

Probably nice to put in the docs somewhere. I was wondering why the example in the docs that I was trying doesn't work at all.

@angelhdzmultimedia
Copy link

The issue is that the Plan 9 server in WSL 2 does not support file watching on Windows files. The workaround is to place your files into the Linux file system (plus you'll get a performance boost).

see microsoft/WSL#4739

Thank you! Solved for me.

@brunolm
Copy link

brunolm commented Oct 2, 2023

I can confirm it doesn't work on Windows folders.

I tried the following example provided in the official documentation: https://bun.sh/docs/runtime/hot#:~:text=In%20this%20example%2C%20Bun%20is

import { serve } from "bun";
console.log("I restarted at:", Date.now());

serve({
  port: 4003,

  fetch(request) {
    return new Response("Sup");
  },
});

The page makes no mention of Windows, WSL, folder, dir, issue, and it doesn't have any sort of a warning for Windows users.

For any Windows users reading this, currently you need to place your projects somewhere in the folder \\wsl$, I choose to place my projects in \\wsl.localhost\Ubuntu\home\USER\dev.

@Electroid Electroid changed the title bun run --watch and --hot doesn't work in WSL for projects in /mnt directory Cannot watch files in /mnt directory on WSL Oct 27, 2023
@Electroid
Copy link
Contributor

Duplicate of #5841

@Electroid Electroid marked this as a duplicate of #5841 Feb 5, 2024
@Electroid Electroid closed this as not planned Won't fix, can't repro, duplicate, stale Feb 5, 2024
@Electroid
Copy link
Contributor

We fill fix this so it works on /mnt

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

6 participants