【发布时间】:2022-10-16 21:05:34
【问题描述】:
我有一个在开发中运行良好的 nextjs 应用程序,但是当部署到 vercel 时出现上述错误
错误日志:
Failed to compile.
ModuleNotFoundError: Module not found: Error: Can't resolve 'next/Script' in '/vercel/path0/fm-platform-nextjs/src/pages'
> Build error occurred
Error: > Build failed because of webpack errors
at /vercel/path0/project/node_modules/next/dist/build/index.js:15:924
at async Span.traceAsyncFn (/vercel/path0/fm-platform-nextjs/node_modules/next/dist/telemetry/trace/trace.js:6:584)
Error: Command "npm run build" exited with 1
我读过我应该使用 git mv oldfilename oldfilename 因为套管。 但我不知道要更改什么,因为远程仓库中的字段与本地仓库相同
【问题讨论】:
-
它应该是
next/script而不是next/Script。