You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If there is an issue loading a CSS dependency, you'll get this error:
Error: Unable to preload CSS for /assets/App-BBLnt7oG.css
However, the error that's thrown can't be worked around, even if e.preventDefault is called on it. If you register an error handler and try to suppress it, you'll get a different error instead:
// This changes the error but is still fatalwindow.addEventListener('vite:preloadError',event=>{event.preventDefault()})// TypeError: Cannot read properties of undefined (reading 'default')
I believe this is because the dep array is loaded with Promise.all, the other deps are blocked. I would suggest using Promise.allSettled.
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Describe the bug
context: nuxt/nuxt#26972
Nuxt reproduction: https://stackblitz.com/edit/github-wg3yu6-bpadkv
Vite-only reproduction: https://stackblitz.com/edit/vitejs-vite-ce8f5t (you'll need to block CSS in your browser devtools)
If there is an issue loading a CSS dependency, you'll get this error:
However, the error that's thrown can't be worked around, even if
e.preventDefault
is called on it. If you register an error handler and try to suppress it, you'll get a different error instead:I believe this is because the dep array is loaded with
Promise.all
, the other deps are blocked. I would suggest usingPromise.allSettled
.The issue can occur in Google crawling a site, for example, if the CSS file references assets that are too large. See this search: https://www.google.com/search?q=%22Unable+to+preload+CSS%22+%22internal+server+error 🙈
Reproduction
https://stackblitz.com/edit/vitejs-vite-ce8f5t
Steps to reproduce
System Info
Used Package Manager
yarn
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: