WARNING: Cloudflare Pages only supports Edge Runtime functions, not the full Node.js runtime.
The cloud router in this project requires a Node.js runtime for Supabase SDK, authentication, sync, and other server-side features that cannot run on Cloudflare's edge runtime.
Workaround: Step 3.4. has been added below, to DELETE the Node.js cloud router - which means that some parts of this application will not work.
- Side effects: Sharing functionality, import from ChatGPT share, and post to Paste.GG will not work
- Cloud features (sync, auth, payments) will not be available
- See Issue 174.
This guide provides steps to deploy your Next.js app on Cloudflare Pages. It is based on the official Cloudflare developer documentation, with some additional steps.
Fork the repository to your personal GitHub account.
Create a project button.Connect To Git and grant Cloudflare Pages access to either all GitHub account repositories or selected repositories.
We recommend using selected Repo access and selecting the forked repository from step 1.Next.js from the Framework preset dropdown menurm app/api/cloud/[trpc]/route.ts && npx @cloudflare/next-on-pages@1Observe the process as it initializes your build environment, clones the GitHub repository, builds the application, and deploys it to the Cloudflare Network. Once complete, proceed to the project you created.
nodejs_compat compatibility flagCompatibility flags and enter "nodejs_compat" for both Production and Preview environments.
It should look like this: Use the Custom domains tab to set up your domain via CNAME.
Navigate to the Settings page and enable the following settings:
*.YOURPROJECT.pages.dev domain.
Refer to Cloudflare Pages known issues
for more details.Congratulations! You have successfully deployed your Next.js app on Cloudflare Pages.
BIG-AGI
Resources
© 2026 Token Fabrics·Built with passion in San Diego