-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Cloudflare Pages Big-AGI [trpc].func not configured to run with the Edge Runtime #174
Comments
I don't know what's the issue here. Recently there has been a change to allow for Prisma to run (not sure if that's the culprit). Basically most pages are on the Edge runtime, but some are on the traditional (Node) runtime. Unfortunately I had to activate both runtimes because Prisma does not (yet) run on the Edge runtime - although they're porting it as we talk. |
I see from the log that it gets to the end of the build.. and the app is all well made, but then it fails to deploy. Can you enable the node.js runtime on Pages? From the bottom of this: |
You mean add |
You know way better. I don't even have a CloudFlare account :) |
Ok. I'm reaching out to a friend who works on Cloudflare Pages team :) |
I'm unable to get it to work, seems to need a specific trpc adapter for CF edge. |
Found a workaround which removes the PRISMA/DB capabilities, but at least the App keeps building: Documented in: |
Sweet @enricoros workaround working nicely 👍
|
Sorry we need to resort to this. I would love to have only Edge runtime endpoints, but Prisma for Postgres cannot run right now. Cost me double the work to have both edge and node endpoints, and lots of tRPC magic. As Prisma folks are working on it, I'll monitor, and can't wait to go back to a single nice Edge runtime. On the other hand I tried Cloudflare and it's a pretty good solution! |
No worries, I don't use the functionality that was lost with the workaround, so isn't missed. Thanks for all your hard work on Big-AGI :)
Yes it is and Cloudflare Pages is free ^_^. Big-AGI is my first next.js project using Cloudflare Pages 😁 |
The instructions still need the But other than that, it works perfectly now! Thanks a lot @enricoros, you're awesome! |
@tmikaeld oh really? I thought with the workaround the compat flag was not needed anymore. Are you 100% sure? Just want to make sure the instructions are simple and correct. |
@enricoros Well, I did upgrade what i had and removed all env. variables, since they're not needed any more. I also removed the flag at first, which then showed an error page that it is needed, after adding it and re-building it worked. So yeah, 99% sure ;) And of course, I selected next.js in the dropdown and changed the build command. Left the rest as is. |
Ok, let's edit the page then :) |
Yeah my successful build on Cloudflare Pages was with |
Confirmed; the compat flag was necessary. Updated the docs (including an image) accordingly. |
@enricoros Could the above be why browse functionality is broken with a CF instance? Ex: when pasting a URL, DevTools shows: |
@JDR42 yes, paradoxically the CloudFlare Puppeteer library requires nodejs, but CloudFlare only supports the Edge runtime - so browsing and Sharing of chats is not supported on a CloudFlare instance. |
I just tried latest Big-AGI update for Cloudflare AI Gateway support #164 on Cloudflare Pages, but it failed to build with specific Cloudflare Pages log error. Prior build that worked was when I built it 3 weeks ago. Attached is full Cloudflare Pages build log.
failed-build.txt
The text was updated successfully, but these errors were encountered: