-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
CSS file from public folder is not loaded correctly #13426
Comments
Start a new pull request in StackBlitz Codeflow. |
Hello @andschuetz. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with |
Hey @andschuetz, please update the reproduction or close and create a new issue. The CSS from public seems to be loading ok if you change |
Hi @patak-dev, Thanks for your comments and sorry for the wrong paths in the repro. I have updated the repro (same URL https://stackblitz.com/edit/vitejs-vite-py4kuh?file=src%2Funsupported.html), removed unnecessary config, and also removed the The described error still occurs. |
Thanks @andschuetz. I've created a new issue with a simplified reproduction (no sass) here: Let's continue tracking it there |
Describe the bug
The following worked until we recently updated vite from 4.1.4 to 4.3.9.
We have a Vue app with multiple entry points (that is, different HTML files with further references).
One of those entry points uses <link...> to load a CSS file from a public directory, and an SCSS file from the client application's directory, which is dynamically processed. Seemingly, the CSS file from the public directory can no longer be loaded (while the SCSS file can be loaded). When the vue app is opened using vite preview, a white page is displayed.
Interestingly, the error message in the browser console states:
even though no such .js file is supposed to be created.
Changing the CSS file's location to /src/ClientApp/... solves the issue. This step can be reconstructed using the stackblitz repro. For reference: the entry point in question is called unsupported.html.
Another entry point (the main index.html) however has no such issue loading the same CSS file from the public directory. The difference here is, however, that no further SCSS file is directly loaded, but rather a vue file is included which in turn imports an SCSS file.
Reproduction
https://stackblitz.com/edit/vitejs-vite-py4kuh?file=src%2Funsupported.html
Steps to reproduce
run vite build and
vite preview
in the stackblitz repro
System Info
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: