![]() That's to make sure that paths in your HTML are relative to the file's directory. Well, honestly, it could, but not if you do things the "right way". Will this affect my web site in the future? Will it cause hosting problems? Node and its various web frameworks such as Svelte, React, etc. This will allow you to develop in a more "real world" environment, as you'll need to do for many features to work (e.g. The browser should open properly using the Windows (rather than WSL/Linux) path.Ī second option, and the one you'll typically use as you get more advanced in your HTML development, is to run a local web server. Start typing "reopen" and select the option Remote-WSL: Reopen in Folder in Windows.In VSCode, press Ctrl+ Shift+ P to open the Command Palette.Side note: The %24 that you are seeing is just the URL-encoded form of $.įirst, a simple solution is to use the Remote-WSL: Reopen in Folder in Windows action: # The "ubuntu" part may vary depending on your exact distribution name As you've found, to a Windows browser, that should look like: file://wsl$/ubuntu/home/pypy/books/paper.htmlįile://wsl.local/ubuntu/home/pypy/books/paper.html So what is really happening is that the path that gets passed to your Windows browser is file://home/pypy/books/paper.html, and a Windows browser isn't going to find a file given that path. It may just not be an option for VSCode extensions to modify the path of files when other (non-extension) actions are acting on the file. Unfortunately, this doesn't seem to be the case. ![]() I would have the same assumption as you that this would "just work." I expected that since we're using the "Remote - WSL" extension in this case, the extension would have handled the path translation. I can reproduce this, and I'm honestly a (little) bit surprised by it. Will this affect my web site in the future? Will it cause hosting problems? How can I fix this? I am confused as to why this is happening and the long term consequences of this. But when it is like this: file://wsl%24/Ubuntu/home/pypy/books/paper.html Why can't I just open it in VSC? It is not finding it in the browser that way. However, when I then right-click on the HTML file and open it via Reveal in Explorer and then copy and paste the URL from there into the browser, it works. When I copy the path from the HTML file in VSCode and try to paste it in the browser it still does not work. It may have been moved, edited, or deleted. I get the following error message: File Not Found. However, when I put the code inside the HTML5 template and try to run it, it does not open in my browser. to begin working on an HTML project in VSCode Created a directory for my code and cd'd to it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |