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

Error when Folder is in WSL 2 filesystem, opened over \\wsl$ #411

Closed
f00f opened this issue Sep 20, 2021 · 4 comments
Closed

Error when Folder is in WSL 2 filesystem, opened over \\wsl$ #411

f00f opened this issue Sep 20, 2021 · 4 comments

Comments

@f00f
Copy link

f00f commented Sep 20, 2021

I have a gatsby project in my WSL 2 home in the linux file system, i.e. in /home/f00f/my-project/.
For editing in VS Code I go to \\wsl$\Ubuntu-20.04\home\f00f\my-project\ in Windows Explorer and then select "Open in VS Code" in the context menu.

So code lives in linux fs, VS Code runs in Windows, linux fs is shared via network (which is a default WSL 2 feature, not configured by me).

When I enable the extension I get the following error message:

[Error - 16:59:26] Tailwind CSS: ENOENT: no such file or directory, open '\wsl$\Ubuntu-20.04\home\f00f\my-project\tailwind.config.js'

which is almost the correct path. Discovery finds the config file, but normalize-path in server.ts : init() changes the actual path and removes the first backslash. That changes the path from a network path to an absolute path on the current drive on Windows.

Note: in a previous comment I wrote the path in the error message with forward slashes. I cannot reproduce whether it really had forward slashes at that time. Right now I see backslashes.

@f00f f00f changed the title Intellisense does not work with Folder in WSL 2 filesystem opened over local network Error when Folder is in WSL 2 filesystem, opened over \\wsl$ Sep 20, 2021
@f00f
Copy link
Author

f00f commented Sep 20, 2021

@SupunSam has the same error, see here: #398 (comment)

@guilherme-marin
Copy link

Same environment(WSL2, Ubuntu/windows 11) and error here. Here is the full output:

[Error - 14:28:59] Tailwind CSS: ENOENT: no such file or directory, open '\wsl$\Ubuntu\home\tainazao\projetos\lojista-next-site\tailwind.config.js' Error: ENOENT: no such file or directory, open '\wsl$\Ubuntu\home\tainazao\projetos\lojista-next-site\tailwind.config.js' at Object.openSync (fs.js:476:3) at Object.func [as openSync] (electron/js2c/asar_bundle.js:5:1846) at Object.readFileSync (fs.js:377:35) at Object.e.readFileSync (electron/js2c/asar_bundle.js:5:8872) at Dn (c:\Users\Guilherme Marin\.vscode\extensions\bradlc.vscode-tailwindcss-0.7.0\dist\server\tailwindServer.js:56:348295) at c:\Users\Guilherme Marin\.vscode\extensions\bradlc.vscode-tailwindcss-0.7.0\dist\server\tailwindServer.js:56:348035 at Nn (c:\Users\Guilherme Marin\.vscode\extensions\bradlc.vscode-tailwindcss-0.7.0\dist\server\tailwindServer.js:56:348228) at c:\Users\Guilherme Marin\.vscode\extensions\bradlc.vscode-tailwindcss-0.7.0\dist\server\tailwindServer.js:56:352952 at Generator.next (<anonymous>) at o (c:\Users\Guilherme Marin\.vscode\extensions\bradlc.vscode-tailwindcss-0.7.0\dist\server\tailwindServer.js:56:348527)

@f00f, Have you found any work around about this error?

@f00f
Copy link
Author

f00f commented Oct 6, 2021

Nope, no workaround yet. I'm using it in a side-project, so putting limited effort in this 😎

@bradlc
Copy link
Contributor

bradlc commented Oct 11, 2021

The file resolution is fixed in v0.7.1, but please note that when you open WSL directories in this way the files cannot be watched for changes, so if you edit your Tailwind config file the changes will not be reflected. Ideally you should follow the VS Code guide for developing in WSL: https://code.visualstudio.com/docs/remote/wsl

@bradlc bradlc closed this as completed Oct 11, 2021
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