reactjs - React App - `无法加载资源:服务器响应状态为 404(未找到)` 在生产构建
问题描述
我有一个项目,使用它运行得非常好,npm start
但是当我使用它在浏览器上构建项目时npm run build
,serve
控制台会出现错误。
Failed to load resource: the server responded with a status of 404 (Not Found)
Refused to apply style from 'http://127.0.0.1:5500/static/css/main.48768b17.chunk.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
我尝试了不同的可能解决方案,但没有一个有效。
解决方案
推荐阅读
- ios - navCtrl.pop 和 navCtrl.removeView 删除 iphone 上的错误页面
- javascript - 如何显示选择标签的选项
- c++ - 无法读取共享内存
- javascript - 如何使用 resolveLocalFilesystemUrl 传递文件并读取它以在 IONIC 3 中上传图片
- google-cloud-dataflow - 通过 Apache Beam 使用 ParquetIO 读取和写入 parquet 文件的示例
- python - 在linux中不小心修改了python
- powershell - 我可以在 PowerShell 中将 system.string 转换为 system.object 吗?
- java - 使用Spring jdbcTemplate时如何检查列名是否存在?
- sql - 通过 where 子句中的不同日期过滤
- javascript - TypeScript 中访问者模式的替代方案(避免使用 instanceof 条件)