由于 webpack 错误,构建失败 -- Vercel 部署 (Next13)

Build failed because of webpack errors -- Vercel deployment (Next13)

提问人:Aryan Mehta 提问时间:10/16/2023 更新时间:10/16/2023 访问量:30

问:

我正在尝试构建一个应用程序并使用 Vercel 部署它,但每次我尝试部署它时,它都会向我抛出此错误日志。

Skipping build cache, deployment was triggered without cache.
Cloning completed: 301.935ms
Running "vercel build"
Vercel CLI 32.4.1
Installing dependencies...

added 791 packages in 18s
 
248 packages are looking for funding
run `npm fund` for details
Detected Next.js version: 13.5.4
Running "npm run build && npx convex deploy"


    Creating an optimized production build ...
Failed to compile.
 
./app/(main)/layout.tsx
Module not found: Can't resolve './_components/navigation'

https://nextjs.org/docs/messages/module-not-found

./app/(marketting)/layout.tsx
Module not found: Can't resolve './_components/navbar'

https://nextjs.org/docs/messages/module-not-found

./app/(marketting)/page.tsx
Module not found: Can't resolve './_components/footer'

https://nextjs.org/docs/messages/module-not-found

./app/(marketting)/page.tsx
Module not found: Can't resolve './_components/heroes'

https://nextjs.org/docs/messages/module-not-found

./app/(marketting)/page.tsx
Module not found: Can't resolve './_components/heading'

https://nextjs.org/docs/messages/module-not-found

> Build failed because of webpack errors
Error: Command "npm run build && npx convex deploy" exited with 1

当我尝试在本地运行该应用程序时,它没有显示任何这些导入错误,并且一切似乎都正常。我的控制台也没有收到警告或错误。

我已确保我的导入是正确的。所有文件均为小写,导出的组件均为大写。我在导入中反映了相同的大小写,但每次构建似乎都失败并显示此日志消息。我什至尝试在删除我的 .next 文件夹后重新部署,以防出现缓存错误,但即使这样似乎也不起作用。谁能帮忙?

谢谢!

TypeScript 部署 Vercel next.js13 build-error

评论


答: 暂无答案