Skip to content

Commit

Permalink
fix: throw Error when can't preload CSS (#7108)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Mar 1, 2022
1 parent 2fd9dd5 commit d9f8edb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/vite/src/node/plugins/importAnalysisBuild.ts
Expand Up @@ -75,7 +75,9 @@ function preload(baseModule: () => Promise<{}>, deps?: string[]) {
if (isCss) {
return new Promise((res, rej) => {
link.addEventListener('load', res)
link.addEventListener('error', rej)
link.addEventListener('error', () =>
rej(new Error(`Unable to preload CSS for ${dep}`))
)
})
}
})
Expand Down

0 comments on commit d9f8edb

Please sign in to comment.