Error message
Use the white screen of the web page packaged by vite, and the console reports an error.
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of “text/plain”. Strict MIME type checking is enforced for module scripts per HTML spec.
reason
MIME type errors are generally a problem with native windows development. I encountered this after opening it with Python’s built-in http.server on Windows.
Solution
Deploy the packaged files in a formal server environment (such as nginx and Apache)
Read More:
- [Solved] Vue project deploys nginx to refresh the interface 404 Error
- [Solved] SyntaxError: Cannot use import statement outside a module
- [Solved] MSBUILD : error MSB3428: Could not load the Visual C++ component “VCBuild.exe“
- How to Solve Bat Script Error: system error 85 has occurred
- Interface request error 504 gateway time out [How to Solve]
- Vue Dynamic Display Picture Error 404: Not Found [How to Solve]
- [Solved] SyntaxError: Cannot use import statement outside a module
- [Solved] NPM err! Cannot read property ‘parent’ of null npm ERR! A complete log of this run can be found in: npm ERR!
- [Solved] gyp ERR! stack Error: Could not find any Python installation to use
- How to Solve Vue-devtool Package Error
- Vuepress build error: window is not defined [How to Solve]
- [Solved] Uncaught SyntaxError: Cannot use import statement outside a module
- The solution to the failure of HTML introducing external JS
- [Solved] Syntax Error: Error: Loading PostCSS Plugin failed: Cannot find module ‘autoprefixer‘
- [Solved] Vue Start Project Error: ValidationError: webpack Dev Server Invalid Options
- [Solved] layui table org.thymeleaf.exceptions.TemplateInputException: An error happened during template…
- After Vite starts, it will prompt “network: use ` — host ` to expose”, and the service cannot be accessed through network IP
- [Solved] electron project Package Error: spawn exe\dll ENOENT
- [Solved] ERROR Error: Cannot find module ‘vue-loader-v16/package.json‘
- [Solved] Error: #error More than 1 blank line not allowed no-multiple-empty-lines