Skip to content
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

[DOCS] Update Cloudflare Pages Deployment Guide for Big-AGI 2 Compatibility #739

Open
saliksik opened this issue Jan 26, 2025 · 3 comments

Comments

@saliksik
Copy link

The current Cloudflare Pages guide for Next.js no longer works for deploying Big-AGI 2.

@enricoros
Copy link
Owner

@saliksik pull requests welcome.

@CoreyRDean
Copy link

I was able to get it deployed to cloudflare by setting the NODE_VERSION environment variable in the page settings to be 22.14.0 as the only step missing, however I am now seeing an issue at runtime with calling the listCapabilities endpoint. Cloudflare throws an error stating: TypeError: Illegal invocation: function called with incorrect this reference. See https://developers.cloudflare.com/workers/observability/errors/#illegal-invocation-errors for details.

@enricoros
Copy link
Owner

Cloudflare is a great platform, and I'm considering making it the preferred cloud platform in the future, due to great edge support, egress pricing, edge DBs, etc.

Background: the Big AGI code is mostly a client-first React application with a (very weak, by design) dependency on NextJS, for client side routing and bundling, mostly. The server side has mostly (or maybe exclusively) a tRPC server, which could be decoupled in the future.

However right now a cloud runtime (Cloudflare) needs to support both: 1. NodeJS vercel runtime, and 2. NextJS Edge runtime (may fall back to 1) -- without any code changes.

I welcome anyone looking seriously into this topic (with the objective of producing a more agnostic Big-AGI that would run on any platform).

The following are promising:

  1. Cloudflare announced OpenNextJS https://opennext.js.org/cloudflare/get-started which is a portability layer to run NextJS full stack app on Cloudflare. This should run Big-AGI, and may require some packaging changes for CF's Wrangler, etc.

  2. Decoupling of Big-AGI's backed from the main project (much easier than it seems because I designed V2 with that in mind, just hadn't gotten to it yet). In this way, the frontend can be static compiled and served on CF's static edge (Pages?), and the backend ported to use NestJS lambdas of sorts.

  3. The current Big-AGI may actually work with little to no changes, since Cloudflare has been gotten more Node compatible with time. Would need someone that's expert with Cloudflare and looks holistically and I merge their PR and discuss the architecture.

I make my time available to someone that's good with Cloudflare and NextJS apps on Cloudflare - just reach out anytime (not a huge priority for me at the moment, given the volume of things going on).

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

No branches or pull requests

3 participants