vue项目启动完成后,浏览器访问无响应,浏览器控制台报错是什么情况?-灵析社区

只想躺平

vue项目npm run dev正常启动无报错,但浏览器访问时总是停留在加载页面,浏览器控制台报错,这种情况经常发生,有时候重启几次就好了 ![image.png](https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20250103/34ca9769751216c8f204773cc2da1bce.png) ![image.png](https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20250103/04ca487ab25870685ceb43aa1b3aaa5f.png) ![image.png](https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20250103/07b10f2478d3c310a5776e9645b72f9a.png) GET http://localhost:8080/js/chunk-vendors.js net::ERR_ABORTED 404 (Not Found) ---------- Refused to execute script from 'http://localhost:8080/js/chunk-vendors.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled. * * * vue.config.js const CompressionWebpackPlugin = require('compression-webpack-plugin'); const { transformElementScss } = require('ele-admin/lib/utils/dynamic-theme'); module.exports = { productionSourceMap: false, configureWebpack: { performance: { maxAssetSize: 2000000, maxEntrypointSize: 2000000 } }, chainWebpack(config) { config.plugins.delete('prefetch'); if (process.env.NODE_ENV !== 'development') { // gzip 压缩 config.plugin('compressionPlugin').use( new CompressionWebpackPlugin({ test: /\.(js|css|html)$/, threshold: 10240 }) ); } }, css: { loaderOptions: { sass: { sassOptions: { outputStyle: 'expanded', importer: transformElementScss() } } } } };

阅读量:310

点赞量:12

问AI
暂时解决了,卸载node.js,重新装了个最新版的node-v18.17.1-x64