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 loading resources from sub-folders. #8

Open
pcarpovich opened this issue Jul 19, 2020 · 2 comments
Open

Error loading resources from sub-folders. #8

pcarpovich opened this issue Jul 19, 2020 · 2 comments

Comments

@pcarpovich
Copy link

I was using a lot the samples to build my own PWA app, I don't know what changed on my VSCode that I cannot run the sample code with Live Server. I get a weird problem with subfolders.

If I remove the first slash from de references it works:

Example: If I change "" into ""

I'll appreciate if someone can give me some help to solve this issue, it happen to me not just with this sample project but also with my own projects.

Capture1
Capture2

@pcarpovich
Copy link
Author

Sorry code sample doesn't show, here it is:

Removing the first slash of de ref, it works

This <link type="text/css" href="css/materialize.min.css" rel="stylesheet"> instead of <link type="text/css" href="/css/materialize.min.css" rel="stylesheet">

It's the same for any reference to css, js, icons.

Thanks!

@pcarpovich
Copy link
Author

OK, I could solve the problem.

I created a folder (.vscode) on the root directory (of the project) and add a file "settings.json" with the folowing config:

{ "liveServer.settings.port": 5505, "liveServer.settings.root": "/public" }

I used this port just to be sure that Live Server takes this configuration.

image

As you can see, now all the files are visible.

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

1 participant