Closed ankitstarski closed 2 years ago
Although that code change was from before SvelteKit switched to Vite. That code no longer exists in SvelteKit as Vite is now responsible for it. That being said I'll go ahead and merge this since it looks like Rich approves of the change
When multiple dynamically imported components are loaded, only one of them resolves the promise. Upon further investigation, I found out that those components were loading
.css
files andinject_styles
function was usingonload
in order to resolveinject_styles
promise.If two components use the same
css
file, the firstonload
will be overridden by the second one.The solution is to replace
onload
withaddEventListener("load", ...
.@Rich-Harris pushed a fix for this in svelte kit (kit#347)