Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vite: 2.4.2 /@vite/client Content-Type: text/html ERROR!!! #4260

Closed
6 tasks done
Zk-Wu opened this issue Jul 15, 2021 · 1 comment
Closed
6 tasks done

vite: 2.4.2 /@vite/client Content-Type: text/html ERROR!!! #4260

Zk-Wu opened this issue Jul 15, 2021 · 1 comment

Comments

@Zk-Wu
Copy link

Zk-Wu commented Jul 15, 2021

Describe the bug

After upgrading vite 2.4.2 version, the following error will appear in the chrome log:
client: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.

Reproduction

Configure in the vite.config.js file:
resolve: { extensions: [], },
WTF!Just configure the'extensions' parameter and it will reproduce 100%

System Info

client: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.

Used Package Manager

npm

Logs

client: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

@sodatea
Copy link
Member

sodatea commented Jul 15, 2021

Duplicate of #4174 (comment)

@sodatea sodatea marked this as a duplicate of #4174 Jul 15, 2021
@sodatea sodatea closed this as completed Jul 15, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jul 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants