Next.js 在 Vercel 上生成错误,但在 Local 中却没有

boh*_*350 8 next.js

因此,我正在使用 Next 开发一个应用程序,当我在本地构建时,一切都运行顺利,并且应用程序已生成,但当我在 Veercel 上发布时,我收到一条错误消息,并且构建失败。

信息:Module not found: Can't resolve '../@constants/Styles/General.css' in '/vercel/path0/pages'

当我检查文件时,它们链接正确,但 Vercel 无法链接工作。

在此输入图像描述

除此之外,错误消息指定了某些模块,但我没有使用它们。

Jam*_*per 8

I also got this error when trying to import a local module / file.

I hadn't realised that the file I was importing was written with a capital letter and when I had changed only the file name's casing, that change wasn't added to my commit.

To fix it, I had to run git mv -f Oldname newname and then commit that change.

The issue occurs due to case-insensitive file systems allowing the local builds to pass (as the path is resolved) but the Vercel build step, being case-sensitive, does not pass.