ChatGPTNextWeb / ChatGPT-Next-Web

A cross-platform ChatGPT/Gemini UI (Web / PWA / Linux / Win / MacOS). 一键拥有你自己的跨平台 ChatGPT/Gemini 应用。
https://app.nextchat.dev/
MIT License
75.37k stars 58.88k forks source link

新特性请求:支持Cloudflare一键部署 #239

Closed latorc closed 1 year ago

latorc commented 1 year ago

作为前端小白,希望能在cloudflare pages部署这个项目。似乎需要把vercel的serverless function改成Cloudflare版本的function,是否有方法可以判断平台?

AprilNEA commented 1 year ago

首先判断平台是可以的,Edge Runtime 改成 Cloudflare Function 也没有多少工作量。 ~但是目前 Cloudflare Pages 还不支持 Next.js13 的实验性功能也就是本项目使用的appDir,故本特性不太可能在短期内被支持。~

可以尝试: https://github.com/cloudflare/next-on-pages

latorc commented 1 year ago

首先判断平台是可以的,Edge Runtime 改成 Cloudflare Function 也没有多少工作量。 ~但是目前 Cloudflare Pages 还不支持 Next.js13 的实验性功能也就是本项目使用的appDir,故本特性不太可能在短期内被支持。~

可以尝试: https://github.com/cloudflare/next-on-pages 试了在CF选择next.js编译,有错误说:

02:18:01.989 ⚡️ Completed 'npx vercel build'.
02:18:01.989 ⚡️
02:18:02.622 ⚡️ ERROR: Failed to produce a Cloudflare Pages build from the project.
02:18:02.622 ⚡️ The following functions were not configured to run with the Edge Runtime:
02:18:02.622 ⚡️
02:18:02.622 ⚡️ - index
02:18:02.622 ⚡️ - index.rsc

不知道怎么解决 = =;

index和index.rsc不知道是什么

latorc commented 1 year ago

image CF的编译设置 NODE_VERSION 是16 似乎CF不支持18

Yidadaa commented 1 year ago

cf 貌似尚未支持 nextjs13,可能需要降级一下 nextjs 版本

AprilNEA commented 1 year ago

image CF的编译设置 NODE_VERSION 是16 似乎CF不支持18

目前手动指定 NODE_VERSION 最高仅能支持到 17

darth-pika-hu commented 1 year ago

@latorc @AprilNEA @Yidadaa 要在Environment variables里,设置NODE_VERSION为18,你设20.1都行。具体看 #982 和 #1368 。