首页 > 解决方案 > React App - `无法加载资源:服务器响应状态为 404(未找到)` 在生产构建

问题描述

我有一个项目,使用它运行得非常好,npm start但是当我使用它在浏览器上构建项目时npm run buildserve控制台会出现错误。

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.

控制台错误

我尝试了不同的可能解决方案,但没有一个有效。

我的/src文件夹:

标签: reactjs

解决方案


推荐阅读