vue项目报错无法正常访问GET http://localhost:8080/js/chunk-vendors.js net::ERR_ABORTED 404 (Not Found) 如何解决?-灵析社区

我只爱钱

项目运行正常,浏览器访问不了项目 1. GET [http://localhost:8080/js/chunk-vendors.js](https://link.segmentfault.com/?enc=i1yXzn0JVrMSsoa3Pl50Ag%3D%3D.3gqyY2RK1LSipefVpJfUKGKz6fZRV5FwN%2Bamk%2Bp2RVtOxJp8yP608eKLhnioJa9Z) net::ERR_ABORTED 404 (Not Found) 2. Refused to execute script from '[http://localhost:8080/js/chunk-vendors.js](https://link.segmentfault.com/?enc=RXnWxbMKqhqiyW0QEUlNcw%3D%3D.IXWKjPLYg%2B%2BHX014S1ZfvBExCKXE8TURrzQd%2Fx7xfHhjphi9pLG5mgfrgiy5MNTU)' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled. ![image.png](https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20250103/930c452eddcd8f4f7f5fe9f11be79211.png) ![image.png](https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20250103/b825b4affb8198432732454ae8eac295.png) ![image.png](https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20250103/5cfab1d8fed0c3ffd7dd2236fbf9a9ff.png) 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() } } } } }; 浏览器显示是404,但是新窗口打开能获取到 ![image.png](https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20250103/077c2ae7b1f969bf4babc601ef84e810.png) ![image.png](https://wmprod.oss-cn-shanghai.aliyuncs.com/images/20250103/6cbb6afb166b7e9c9a343881d941e2cb.png)

阅读量:350

点赞量:14

问AI
是不是地址错误, 特别是公共路径的配置 一般静态资源不是 static/** 这样的吗? 感觉你的提问也有问题, 一般 404 就是当前地址没有, 不管啥原因,就是文件没拿到, 关键是后面 because its not mime type ** 我也是网上查了之后发现的类似问题