when using <ClientOnly> nuxt3 application fails with the following error: "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."
See original GitHub issueEnvironment
- Operating System:
Darwin
- Node Version:
v14.18.2
- Nuxt Version:
3.0.0-rc.6
- Package Manager:
npm@6.14.15
- Builder:
vite
- User Config:
-
- Runtime Modules:
-
- Build Modules:
-
Reproduction
1). Clone the following project: https://github.com/Schetnan/nuxttest 2). Execute the following instructions
npm install npm run build2 ( build using ‘node’ preset ) npm run start:express In browser, go to: http://localhost:8082/fcp/tst
Describe the bug
Application will come up with a blank screen and in the console, the following error:
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.
Additional context
No response
Logs
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.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Expected a JavaScript module script but the server responded ...
"Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type...
Read more >How To Fix Failed To Load Module Script
js :1 Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/plain". Strict...
Read more >Plugins directory - Nuxt
The plugins directory contains your Javascript plugins that you want to run before instantiating the root Vue.js Application.
Read more >Javascript .mjs extension for module script includes has wrong ...
Using Wrangler (v2) to publish a Nuxt 3 app with server-side rendering ... works and the site HTML loads but it has a...
Read more >Creating Server-side Rendered Vue.js Apps Using Nuxt.js
When initially loading your website, your browser doesn't receive a complete page to display. Instead, it gets a bunch of pieces and instructions...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi. I think we can close this issue.
We have added to this code for server configuration.
Thank you. @misaon
Its about web server configuration, not Nuxt problem…