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
WSL Support #16
Comments
+1 |
Just want to confirm that it does not work on WSL2. Tried everything, like setting the LAUNCH_EDITOR=code variable in a .env file etc. Not sure, but the problem might be related to the fact, that while WSL2 is Linux, so the development code runs on Linux, the editor and the browser themselves still run on the Windows OS. |
Just stumbled upon this issue and toyed with it for a bit and found a solution. Open your VS Code settings, either This causes it the inspector to open files correctly either when running the dev server manually or when using the Vite extensions Example {
// other config...
"terminal.integrated.env.linux": {
"EDITOR": "code"
}
} |
The solution proposed by @gtdrakeley works perfectly for anything in the project scope (routes, lib, and even custom paths (via path.resolve)). It's a great time saver already! Unfortunately, components outside that scope show the correct component path highlighted on the page, but a click does not open the component in the editor. This makes it impossible to use the inspector for monorepos on WSL with local packages (like Design Systems) etc. I suspected that it might have had something to do with the Vite config — in particular server.fs.allow — but providing the paths outside my root did not solve the problem. |
It only works when you launch the vite dev server using VS code's integrated terminal. I usually use just to launch everything with one command like |
@silenceofthewans Yes, I only used that, and it worked for me. But unfortunately not for everything, as stated in my prior reply. It worked for files in src, $lib, but not for files outside the project scope, like our design system or other packages which are co-located in a common monorepo. This makes the inspector only semi-useful in my case, which is sad, because it's such a great feature. |
@codepainting I edited my comment but I think you might also be using the integrated terminal to launch your dev server because I tested and svelte inspector only opens the file in vscode if you used the same vscode instance to launch your dev server. This comment mentions same. |
the CMD+CLICK does not open the file, when I am using turborepo and the component is from an internal package. |
For some reason setting only |
It works perfectly for me by adding
to your favorite shell config ( You may also want to add
|
Hello @silenceofthewans do you find any solution for this? I'm using Windows Terminal with WSL 2 and Laravel Sail. Could not open Dashboard.vue in the editor.
The editor process exited with an error: spawn code ENOENT. |
It doesn't appear to work when serving from Windows Subsystem for Linux.
Is this a possibility?
The text was updated successfully, but these errors were encountered: