Skip to content

一键部署失败以及部署成功后gemini不回复的修复 #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 24, 2025

Conversation

seraph333
Copy link
Contributor

@seraph333 seraph333 commented Apr 11, 2025

问题1:一键部署时失败,提示:"Deploy did not succeed: Build cancelled, found file owned by root"​​
原因:Netlify 会自动运行 npm install 或 yarn install,所以 ​​node_modules 不应提交到 GitHub​​
解决:删除.gitignore内的node_modules后部署成功。

问题2:部署成功后,gemini不回复,netlify报错:"TypeError: RequestInit: duplex option is required when sending a body."
原因:当Netlify Function 使用 fetch() 发送带有请求体(如 POST、PUT)的请求时,​​必须显式设置 duplex: "half"
解决:在proxy.ts文件做以下修改,
const response = await fetch(url, { body: request.body, method: request.method, headers, duplex: "half" // 必须添加此行 });

Copy link

netlify bot commented Apr 11, 2025

Deploy Preview for imaginative-pavlova-1f9670 ready!

Name Link
🔨 Latest commit 7af38f7
🔍 Latest deploy log https://app.netlify.com/sites/imaginative-pavlova-1f9670/deploys/67f8bab4e970fb0008e01869
😎 Deploy Preview https://deploy-preview-8--imaginative-pavlova-1f9670.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

@lf2941270 lf2941270 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我也遇到这个问题了,用同样的方式可以修复,新版的fetch需要传 duplex 参数,不然会报错

@antergone antergone merged commit 2e721c6 into antergone:main Jun 24, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants