-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Closed
Labels
feat: cssfeat: ssrp2-edge-caseBug, but has workaround or limited in scope (priority)Bug, but has workaround or limited in scope (priority)regressionThe issue only appears after a new releaseThe issue only appears after a new release
Description
Describe the bug
I have a setup where I write inlined CSS in index.html file. I expect this inlined CSS to work as it is in dev-server and it did work before 2.9 however after 2.9 the inlined CSS turns into something like this in the source -
<script type="module" src="/?html-proxy&index=0.css"></script>Apparently, it is happening during vite.transformIndexHtml API. It returns new HTML with proxy script instead of actual inlined css. Due to this the CSS is not applied during the dev-server.
The build continues to work fine.
Reproduction
https://stackblitz.com/edit/github-12zodn-vbxsug?file=index.html&terminal=dev
Exactly same example on Vite 2.8.6 - https://stackblitz.com/edit/github-12zodn-34x7n1?file=package.json&terminal=dev (works as expected)
System Info
System:
OS: macOS 11.4
CPU: (8) x64 Apple M1
Memory: 520.12 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.5.0 - ~/.nvm/versions/node/v16.5.0/bin/node
Yarn: 1.22.15 - ~/.yarn/bin/yarn
npm: 7.19.1 - ~/.nvm/versions/node/v16.5.0/bin/npm
Browsers:
Brave Browser: 97.1.34.80
Chrome: 100.0.4896.127
Safari: 14.1.1Used Package Manager
npm
Logs
/?html-proxy&index=0.css:1 Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.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 https://github.com/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.
Metadata
Metadata
Assignees
Labels
feat: cssfeat: ssrp2-edge-caseBug, but has workaround or limited in scope (priority)Bug, but has workaround or limited in scope (priority)regressionThe issue only appears after a new releaseThe issue only appears after a new release
