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
It seems like trying to help vite make sense of a module structure is causing duplication. This is relevant for module workers (see the related #13355), but also in general even for the main script. See the reproduction case and compare the output for rel=preload vs. rel=modulepreload.
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.
I think this is essentially a same issue as #13355 and it's not supported as a current index.html feature. For now, injecting to <head> manually via plugin as suggested in #13355 (comment) looks like a legitimate solution to me.
Thanks, closing in favor of #13355 then. It's still somewhat surprising to me that vite sees independent resources, even if the files have the exact same URL and are being referenced in the same index.html entry point, but I'm absolutely not an expert there, just a naive (and very thankful and content) user.
Activity
bolt-new-by-stackblitz commentedon Mar 25, 2024
Remove `rel=modulpreload` for now
hi-ogawa commentedon Mar 26, 2024
I think it's not just duplication, but
<link rel="modulepreload" href="/main.js" />is simply considered as an static asset and the script is not processed. It would be clearer when using typescript likehref="/main.ts"https://stackblitz.com/edit/vitejs-vite-u9ok5x?file=dist%2Fassets%2Fmain-zn5ORrD-.tsI think this is essentially a same issue as #13355 and it's not supported as a current
index.htmlfeature. For now, injecting to<head>manually via plugin as suggested in #13355 (comment) looks like a legitimate solution to me.tomayac commentedon Mar 26, 2024
Thanks, closing in favor of #13355 then. It's still somewhat surprising to me that vite sees independent resources, even if the files have the exact same URL and are being referenced in the same
index.htmlentry point, but I'm absolutely not an expert there, just a naive (and very thankful and content) user.