webpack - 由于 Webpack 错误,nextJS 在 Vercel 上构建失败
问题描述
我试图部署到 Vercel 我以前用其他项目做过,但在这种情况下,构建失败,它提到它没有找到页脚组件,构建在本地机器上完美运行。
11:55:14.850 Cloning completed in 533ms
11:55:14.851 Analyzing source code...
11:55:17.183 Installing build runtime...
11:55:17.605 Build runtime installed: 422.099ms
11:55:18.023 Looking up build cache...
11:55:18.054 Build cache not found
11:55:18.481 Installing dependencies...
11:55:18.694 yarn install v1.22.4
11:55:18.757 [1/4] Resolving packages...
11:55:19.090 [2/4] Fetching packages...
11:55:27.361 info fsevents@2.1.3: The platform "linux" is incompatible with this module.
11:55:27.361 info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
11:55:27.365 info fsevents@1.2.13: The platform "linux" is incompatible with this module.
11:55:27.365 info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
11:55:27.369 [3/4] Linking dependencies...
11:55:27.371 warning "@apollo/react-hooks > @apollo/client@3.1.2" has unmet peer dependency "subscriptions-transport-ws@^0.9.0".
11:55:27.376 warning " > eslint-config-airbnb@18.2.0" has unmet peer dependency "eslint-plugin-react-hooks@^4 || ^3 || ^2.3.0 || ^1.7.0".
11:55:30.997 [4/4] Building fresh packages...
11:55:31.210 Done in 12.52s.
11:55:31.233 Running "yarn run build"
11:55:31.491 yarn run v1.22.4
11:55:31.513 $ next build
11:55:31.973 Browserslist: caniuse-lite is outdated. Please run next command `yarn upgrade`
11:55:32.044 Warning: No build cache found. Please configure build caching for faster rebuilds. Read more: https://err.sh/next.js/no-cache
11:55:32.044 Creating an optimized production build...
11:55:32.098 Attention: Next.js now collects completely anonymous telemetry regarding usage.
11:55:32.098 This information is used to shape Next.js' roadmap and prioritize features.
11:55:32.099 You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
11:55:32.099 https://nextjs.org/telemetry
11:55:44.385 Failed to compile.
11:55:44.385 ./components/App.js
11:55:44.385 Module not found: Can't resolve './Footer' in '/vercel/2e0a566d/components'
11:55:44.385 > Build error occurred
11:55:44.386 Error: > Build failed because of webpack errors
11:55:44.386 at build (/vercel/2e0a566d/node_modules/next/dist/build/index.js:13:900)
11:55:44.410 error Command failed with exit code 1.
11:55:44.410 info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
11:55:44.419 Error: Command "yarn run build" exited with 1
11:55:46.448 Done with "package.json"
解决方案
我得到了支持的帮助,似乎即使我的本地组件是大写的,远程分支的一些组件也是小写的。
推荐阅读
- javascript - 如何在javascript中获取带有http会话的字符串?
- c++ - 谷歌测试错误。无法包含:#include <gtest/gtest.h> in VS Code
- javascript - 在自定义钩子中,为什么返回发生在 useEffect 之前
- android - 如何在Android中排除Androidx或强制不使用Androidx依赖
- android - 将 ConstraintLayout 的宽度设置为 match_parrent
- c# - 如何使用 Web 客户端获取网页标题?
- google-cloud-platform - 在 Google Cloud Platform 上使用应用程序交付的自托管 Gitlab
- sql - SQL Server - 根据来自两个不同表的值填充关系表
- angular - 使用 JWT 的 Spring Websockets
- python - Python 字典 - 通过迭代进行键分配