Vite is not loading CSS codes that are inside of VUE components #132
Unanswered
mahbubahmed
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My application is built with Laravel, and Inertia.js with Vue. I am using Vite to bundle the frontend files.
Generally, the application works fine, however, when I put the application inside a subdirectory, Vite does not load the CSS codes that are inside the .vue files or components.
As a result, it shows a blank page when I visit the page URL example.com/subdirectory/login
The browser console shows the following:
Uncaught (in promise) Error: Unable to preload CSS for /build/assets/Login.a0d488b1.css d http://example.com/subdirectory/build/assets/app.6486bb89.js:1
In this case, I am trying to visit the Login page/component. However, it is failing to load the Login.a0d488b1.css file because it is missing the subdirectory name at the beginning of its path.
Could you please tell me how to solve this problem?
My vite.config.js file looks like the following:
Beta Was this translation helpful? Give feedback.
All reactions