vite: index.html without JS breaks multi-page app setup linking to the same stylesheet
Describe the bug
There are two entry points (index.html and nojs.html). Both of them link to the same CSS stylesheet. There is an import for import"./nojs-ab7f0fe6.js";
in the generated main output, importing a file that doesn’t exists in the dist folder.
Note: Originally as #13426. Starting a new issue with a simplified reproduction.
Reproduction
https://stackblitz.com/edit/vitejs-vite-uhnk5n
Steps to reproduce
npm install npm run build
System Info
StackBlitz
Used Package Manager
npm
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- 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.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 2
- Comments: 15 (10 by maintainers)
Commits related to this issue
- fix: #13436 — committed to sun0day/vite by sun0day a year ago
I can offer a rollup upgrade PR. Then we could see how to fix this issue
Locally I can’t reproduce it when linking against Vite main. But it is the same commit, so maybe the fact that we are linking affects this bug? I’m even more puzzled now.