-
Notifications
You must be signed in to change notification settings - Fork 60.1k
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
Update cloudflare-pages-cn.md #3183
Conversation
cloudflare 构建命令
|
你好,可以检查下配置是否和我的一样? 昨天晚上自动部署是成功的,
[image: image.png]
[image: image.png]
[image: image.png]
Ylarod ***@***.***> 于2023年11月14日周二 14:45写道:
… 我这边无法构建,方便看看是哪里出问题了吗 @hekbobo <https://github.com/hekbobo>
14:30:29.890 | ⚡️ ERROR: Failed to produce a Cloudflare Pages build from the project.
-- | --
14:30:29.890 | ⚡️
14:30:29.890 | ⚡️ The following routes were not configured to run with the Edge Runtime:
14:30:29.890 | ⚡️ - /api/cors/[...path]
14:30:29.890 | ⚡️
14:30:29.890 | ⚡️ Please make sure that all your non-static routes export the following edge runtime route segment config:
14:30:29.891 | ⚡️ export const runtime = 'edge';
14:30:29.891 | ⚡️
14:30:29.891 | ⚡️ You can read more about the Edge Runtime on the Next.js documentation:
14:30:29.891 | ⚡️ https://nextjs.org/docs/app/building-your-application/rendering/edge-and-nodejs-runtimes
14:30:29.891 |
14:30:29.930 | Failed: Error while executing user command. Exited with error code: 1
14:30:29.940 | Failed: build command exited with code: 1
14:30:30.944 | Failed: error occurred while running build command
—
Reply to this email directly, view it on GitHub
<#3183 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJQ55OPCDHGM5ANJWMOFWDYEMHSHAVCNFSM6AAAAAA7CSCGVKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBZGYZTCNZVG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
已经解决了,代码中的 nodejs 替换成 edge 就可以了。 |
如果不行可以尝试把 route.ts 中的 api export const runtime = "nodejs";
改为
export const runtime = "edge";
yibo zhou ***@***.***> 于2023年11月14日周二 15:13写道:
… 你好,可以检查下配置是否和我的一样? 昨天晚上自动部署是成功的,
[image: image.png]
[image: image.png]
[image: image.png]
Ylarod ***@***.***> 于2023年11月14日周二 14:45写道:
> 我这边无法构建,方便看看是哪里出问题了吗 @hekbobo <https://github.com/hekbobo>
>
> 14:30:29.890 | ⚡️ ERROR: Failed to produce a Cloudflare Pages build from the project.
> -- | --
> 14:30:29.890 | ⚡️
> 14:30:29.890 | ⚡️ The following routes were not configured to run with the Edge Runtime:
> 14:30:29.890 | ⚡️ - /api/cors/[...path]
> 14:30:29.890 | ⚡️
> 14:30:29.890 | ⚡️ Please make sure that all your non-static routes export the following edge runtime route segment config:
> 14:30:29.891 | ⚡️ export const runtime = 'edge';
> 14:30:29.891 | ⚡️
> 14:30:29.891 | ⚡️ You can read more about the Edge Runtime on the Next.js documentation:
> 14:30:29.891 | ⚡️ https://nextjs.org/docs/app/building-your-application/rendering/edge-and-nodejs-runtimes
> 14:30:29.891 |
> 14:30:29.930 | Failed: Error while executing user command. Exited with error code: 1
> 14:30:29.940 | Failed: build command exited with code: 1
> 14:30:30.944 | Failed: error occurred while running build command
>
> —
> Reply to this email directly, view it on GitHub
> <#3183 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAJQ55OPCDHGM5ANJWMOFWDYEMHSHAVCNFSM6AAAAAA7CSCGVKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBZGYZTCNZVG4>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
我遇到的是如下报错: |
cloudflare构建命令 (2023/11/8 验证部署成功)