简体   繁体   English

部署到 Vercel 时出现错误。 谁能帮我解决下面的问题?

[英]I am getting errors when deploying to Vercel. Can anyone help me with the my issues below?

Cloning github.com/gmcnally78/-Final-Data-Driven-FullStack-App2 (Branch: main, Commit: e1d0133)克隆 github.com/gmcnally78/-Final-Data-Driven-FullStack-App2 (Branch: main, Commit: e1d0133)

Cloning completed: 643.936ms克隆完成:643.936ms

Analyzing source code...分析源代码...

Installing build runtime...正在安装构建运行时...

Build runtime installed: 2.278s安装的构建运行时:2.278s

Looking up build cache...正在查找构建缓存...

Build Cache not found未找到构建缓存

Installing dependencies...安装依赖...

yarn install v1.22.17纱线安装 v1.22.17

[1/4] Resolving packages... [1/4] 解决包...

[2/4] Fetching packages... [2/4] 正在取包...

[3/4] Linking dependencies... [3/4] 链接依赖...

warning " > @chakra-ui/icons@1.1.1" has unmet peer dependency "@chakra-ui/system@>=1.0.0".警告“ > @chakra-ui/icons@1.1.1”具有未满足的对等依赖性“@chakra-ui/system@>=1.0.0”。

warning "@chakra-ui/icons > @chakra-ui/icon@1.2.1" has unmet peer dependency "@chakra-ui/system@>=1.0.0".警告“@chakra-ui/icons > @chakra-ui/icon@1.2.1”具有未满足的对等依赖性“@chakra-ui/system@>=1.0.0”。

warning "@emotion/styled > @emotion/babel-plugin@11.7.1" has unmet peer dependency "@babel/core@^7.0.0".警告“@emotion/styled > @emotion/babel-plugin@11.7.1”具有未满足的对等依赖关系“@babel/core@^7.0.0”。

warning "@emotion/styled > @emotion/babel-plugin > @babel/plugin-syntax-jsx@7.16.5" has unmet peer dependency "@babel/core@^7.0.0-0".警告“@emotion/styled > @emotion/babel-plugin > @babel/plugin-syntax-jsx@7.16.5”具有未满足的对等依赖关系“@babel/core@^7.0.0-0”。

warning "next > styled-jsx > @babel/plugin-syntax-jsx@7.14.5" has unmet peer dependency "@babel/core@^7.0.0-0".警告 "next > styled-jsx > @babel/plugin-syntax-jsx@7.14.5" 具有未满足的对等依赖关系 "@babel/core@^7.0.0-0"。

warning " > eslint-config-next@11.1.0" has unmet peer dependency "eslint@^7.23.0".警告“ > eslint-config-next@11.1.0”具有未满足的对等依赖性“eslint@^7.23.0”。

warning "eslint-config-next > @typescript-eslint/parser@4.29.0" has unmet peer dependency "eslint@^5.0.0 || ^6.0.0 || ^7.0.0".警告“eslint-config-next > @typescript-eslint/parser@4.29.0”具有未满足的对等依赖性“eslint@^5.0.0 || ^6.0.0 || ^7.0.0”。

warning "eslint-config-next > eslint-import-resolver-typescript@2.4.0" has unmet peer dependency "eslint@*".警告“eslint-config-next > eslint-import-resolver-typescript@2.4.0”具有未满足的对等依赖项“eslint@*”。

warning "eslint-config-next > eslint-plugin-import@2.23.4" has unmet peer dependency "eslint@^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0".警告“eslint-config-next > eslint-plugin-import@2.23.4”具有未满足的对等依赖关系“eslint@^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0” .

warning "eslint-config-next > eslint-plugin-jsx-a11y@6.4.1" has unmet peer dependency "eslint@^3 || ^4 || ^5 || ^6 || ^7".警告“eslint-config-next > eslint-plugin-jsx-a11y@6.4.1”具有未满足的对等依赖关系“eslint@^3 || ^4 || ^5 || ^6 || ^7”。

warning "eslint-config-next > eslint-plugin-react@7.24.0" has unmet peer dependency "eslint@^3 || ^4 || ^5 || ^6 || ^7".警告“eslint-config-next > eslint-plugin-react@7.24.0”具有未满足的对等依赖性“eslint@^3 || ^4 || ^5 || ^6 || ^7”。

warning "eslint-config-next > eslint-plugin-react-hooks@4.2.0" has unmet peer dependency "eslint@^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0".警告“eslint-config-next > eslint-plugin-react-hooks@4.2.0”具有未满足的对等依赖关系“eslint@^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 | | ^7.0.0”。

[4/4] Building fresh packages... [4/4] 构建新包...

success Saved lockfile.成功保存的锁文件。

Done in 47.72s.在 47.72 秒内完成。

Detected Next.js version: 11.1.3检测到 Next.js 版本:11.1.3

Running "yarn run build"运行“纱线运行构建”

yarn run v1.22.17纱线运行 v1.22.17

$ next build $ 下一个构建

info - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5信息 - 使用 webpack 5. 原因:默认启用https://nextjs.org/docs/messages/webpack5

Attention: Next.js now collects completely anonymous telemetry regarding usage.注意:Next.js 现在收集有关使用情况的完全匿名遥测数据。

This information is used to shape Next.js' roadmap and prioritize features.此信息用于塑造 Next.js 的路线图并确定功能的优先级。

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:您可以通过访问以下 URL 了解更多信息,包括如果您不想参与此匿名计划如何选择退出:

https://nextjs.org/telemetry https://nextjs.org/telemetry

Browserslist: caniuse-lite is outdated. Browserslist:caniuse-lite 已过时。 Please run:请运行:

npx browserslist@latest --update-db npx browserslist@latest --update-db

Why you should do it regularly:为什么你应该经常这样做:

https://github.com/browserslist/browserslist#browsers-data-updating https://github.com/browserslist/browserslist#browsers-data-updating

info - Checking validity of types... info - 检查类型的有效性...

warn - No ESLint configuration detected.警告 - 未检测到 ESLint 配置。 Run next lint to begin setup运行下一个 lint 开始设置

info - Creating an optimized production build... info - 创建优化的生产版本...

Browserslist: caniuse-lite is outdated. Browserslist:caniuse-lite 已过时。 Please run:请运行:

npx browserslist@latest --update-db npx browserslist@latest --update-db

Why you should do it regularly:为什么你应该经常这样做:

https://github.com/browserslist/browserslist#browsers-data-updating https://github.com/browserslist/browserslist#browsers-data-updating

Failed to compile.编译失败。

ModuleNotFoundError: Module not found: Error: Can't resolve '../components/Header' in '/vercel/path0/pages/todos' ModuleNotFoundError:找不到模块:错误:无法解析“/vercel/path0/pages/todos”中的“../components/Header”

Build error occurred发生构建错误

Error: > Build failed because of webpack errors错误:> 由于 webpack 错误,构建失败

at /vercel/path0/node_modules/next/dist/build/index.js:397:19

at async Span.traceAsyncFn

(/vercel/path0/node_modules/next/dist/telemetry/trace/trace.js:60:20) at async Object.build [as default] (/vercel/path0/node_modules/next/dist/telemetry/trace/trace.js:60:20) 在异步 Object.build [默认]

(/vercel/path0/node_modules/next/dist/build/index.js:77:25) (/vercel/path0/node_modules/next/dist/build/index.js:77:25)

error Command failed with exit code 1.错误命令失败,退出代码为 1。

info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. info 访问https://yarnpkg.com/en/docs/cli/run以获取有关此命令的文档。

Error: Command "yarn run build" exited with 1错误:命令“yarn run build”以 1 退出

info - Loaded env from /Users/gregmcnally/Downloads/CS55.13-todo-app-week-8-main/.env.local info - 从 /Users/gregmcnally/Downloads/CS55.13-todo-app-week-8-main/.env.local 加载的环境

info - Using webpack 5. Reason: Enabled by default信息 - 使用 webpack 5. 原因:默认启用

https://nextjs.org/docs/messages/webpack5 https://nextjs.org/docs/messages/webpack5

Failed to compile.编译失败。

./pages/ssr-no-token.tsx:62:51 ./pages/ssr-no-token.tsx:62:51

Type error: Argument of type 'IncomingMessage & { cookies: NextApiRequestCookies;类型错误:'IncomingMessage & { cookies: NextApiRequestCookies; 类型的参数}' is not assignable to parameter of type 'null | }' 不能分配给类型为“null |”的参数undefined'.不明确的'。

Type 'IncomingMessage & { cookies: NextApiRequestCookies;输入'IncomingMessage & { cookies: NextApiRequestCookies; }' is not assignable to type 'null'. }' 不可分配给类型 'null'。

VS CODE 60 | VS 代码 60 | // withAuthUserTokenSSR . // withAuthUserTokenSSR . 61 | 61 | const token = await AuthUser.getIdToken()常量令牌 = 等待 AuthUser.getIdToken()

62 | 62 | const endpoint = getAbsoluteURL('/api/example', req) |常量端点 = getAbsoluteURL('/api/example', req) | ^ 63 | ^ 63 | const response = await fetch(endpoint, { 64 | method: 'GET', 65 | headers: { info - Checking validity of types.npm ERR. code ELIFECYCLE npm ERR. errno 1 npm ERR: todo-app-week08@0.1.0 build: next build npm ERR. Exit status 1 npm ERR. npm ERR. Failed at the todo-app-week08@0.1.0 build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. const response = await fetch(endpoint, { 64 | method: 'GET', 65 | headers: { info - Checking validity of types.npm ERR. code ELIFECYCLE npm ERR. errno 1 npm ERR: todo-app-week08@0.1. 0 build: next build npm ERR. Exit status 1 npm ERR. npm ERR. Failed at the todo-app-week08@0.1.0 build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output以上。

npm ERR: A complete log of this run can be found in. npm ERR. npm ERR:此运行的完整日志可在 npm ERR 中找到。 /Users/gregmcnally/.npm/_logs/2021-12-16T06_44_01_675Z-debug.log gregmcnally@Gregs-MBP CS55.13-todo-app-week-8-main % /Users/gregmcnally/.npm/_logs/2021-12-16T06_44_01_675Z-debug.log gregmcnally@Gregs-MBP CS55.13-todo-app-week-8-main %

Firstly I'd recommend that you try run:首先,我建议您尝试运行:

yarn build or npm run build locally, as you'll be able to catch a lot of these errors before attempting to deploy on Vercel. yarn buildnpm run build ,因为在尝试在 Vercel 上部署之前,您将能够发现很多这些错误。

There are a few errors:有几个错误:

ModuleNotFoundError: Module not found: Error: Can't resolve '../components/Header' in '/vercel/path0/pages/todos'

Tells us that your project is unable to resolve an import for the "Header" component in your todos page.告诉我们您的项目无法解析待办事项页面中“标题”组件的导入。 Have a look at that page in your project and ensure you're using the right import path.查看项目中的该页面并确保使用正确的导入路径。

Secondly, there is a type error in ssr-no-token.tsx: and so type validation is causing the build to fail.其次, ssr-no-token.tsx:中存在类型错误,因此类型验证导致构建失败。

 Type error: Argument of type 'IncomingMessage & { cookies: NextApiRequestCookies; }' is 
not assignable to parameter of type 'null | undefined'.

If we look at the error message we can see that you need to add checks to ensure that cookies is not null or undefined (and is the type NextApiRequestCookies )如果我们查看错误消息,我们可以看到您需要添加检查以确保 cookies 不是nullundefined (并且是NextApiRequestCookies类型)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当我编写 npm start 并收到此错误时,我的反应应用程序没有启动,任何人都可以帮助我,我是新来的反应。 我正在使用 Acode(Editor) 和 termux - My react app does not start when I write npm start and get this error can anyone please help me I am new to react. I am using Acode(Editor) and termux 任何人都可以帮助我安装 React 吗? 我收到了这个奇怪的错误 - Can anyone help me with React Installation? I am getting this weird error 谁能让我知道为什么会收到此错误? - Can anyone let me know why am I getting this error? 我正在尝试使用yeoman和骨干创建示例应用程序,但显示一些错误有人可以帮助我吗? - I am trying to create sample app using yeoman and backbone but display some error can anyone help me? 我的服务器列表命令不和谐机器人错误,任何人都可以帮助我 - my serverlist commands discord bot error, anyone can help me 为什么我会收到此错误,同样的事情在我的本地计算机上有效,但在容器中却无效帮助我 - Why am I getting this error same thing works on my local machine but not in a container help me 我正在尝试将我的 Express 应用程序部署到 Vercel,但出现错误 - I am trying to deploy my express app to vercel but gives me error 任何人都可以指导我运行此脚本时发生了什么吗? 我错过了什么,我该如何解决? - Can anyone please guide me on whats going on when I run this script? What am i missing and how can I fix it? 在我的angular2应用程序上运行npm install和ng serve时,出现以下错误 - I am getting an below error when i run npm install and ng serve on my angular2 application 为什么将我的 Angular 项目部署到 Heroku 时出现 ng not found 错误? - Why am I getting an ng not found error when deploying my Angular project to Heroku?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM