Next JS npm start app load 404 page not found 物理页面错误

Elv*_*dov 7 javascript reactjs npm-start next.js

我的项目与run dev命令运行良好,但是当我尝试npm start 时,除了 Index.js 之外,其他页面(pages/...)出现 404 page not found 错误。

我尝试了几种从表单(gthub 问题和博客)中找到的方法,但没有任何效果。

任何的想法?实际上为什么 run dev 和 start 之间应该有区别?我认为我们应该在开发过程中看到我们的应用程序出了什么问题

package.json 中的脚本

"scripts": {
  "dev": "next",
  "start": "next start",
  "build": "next build"
Run Code Online (Sandbox Code Playgroud)

},

和 next.config.js

const withCSS = require("@zeit/next-css");
module.exports = withCSS({
  cssModules: true,
  cssLoaderOptions: {
    importLoaders: 1,
    localIdentName: "[local]___[hash:base64:5]"
  }});
Run Code Online (Sandbox Code Playgroud)

如您所见,安装 nextJS 后我没有进行任何更改。

在此处输入图片说明 在此处输入图片说明

小智 6

我发现如果文件名在 Windows 上有大写字母,则会出现 404 错误。

我将所有文件名更改为小写字符,404 错误消失了。