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

dev-server not updating on Windows WSL #2221

Open
matejhrachovina opened this issue Apr 12, 2023 · 3 comments
Open

dev-server not updating on Windows WSL #2221

matejhrachovina opened this issue Apr 12, 2023 · 3 comments

Comments

@matejhrachovina
Copy link

The dev-server does not update the build upon file change in Windows 11 WSL 2 (v 1.2.0.0).
The initial page is built ok, but upon file changes, it still serves the files, that were built upon running the npm start command. Even manual refresh of the page doesn't help.
I have read the documentation, set the --watch flag and the rootDir and basePath paths, but neither of those worked.
Tested on a clean SPA project scaffolded with npm init @open-wc.

@tannerstern
Copy link
Contributor

One of my coworkers had this same issue. It turned out that he had cloned his repo into a "mounted" location (/mnt/c which is how you access the Windows C: drive in WSL). We fixed by cloning his repo into a subdirectory under home (~/workspace for example) instead.

Not sure if your issue is caused by a similar location issue, but I figured it was worth mentioning!

@Matsuuu
Copy link
Contributor

Matsuuu commented Jan 19, 2024

I am also experiencing this issue with a dockerized environment running WDS for local development on windows

@Matsuuu
Copy link
Contributor

Matsuuu commented Mar 22, 2024

Just commenting here in case someone runs into this:

After the above PR has been merged, and it's now released, you can use chokidar options to circumvent this problem

/** @type { import("@web/dev-server").DevServerConfig } */
export default {
    // nodeResolve: true,
  watch: true,
  appIndex: "index.html",
  chokidarOptions: {
    usePolling: true
  }
};```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants