Deploy Plasmic Next.js. to Cloudflare Pages?

Hey guys,

I’m trying to figure out the best way to deploy my Plasmic + Next.js project to Cloudflare Pages / Workers since several days now.
Is there a recommended setup or example for this? Maybe someone here already has a working flow or best practice for using Plasmic with Cloudflare (especially with codegen)?

Would really appreciate any tips or examples :raising_hands:

Hi @bastian_ramoser, welcome to the Plasmic forum!

I would recommend deploying Plasmic (with headless loader) + Next.js following this guide: Get started · Cloudflare Pages docs

Was there a specific reason you might want codegen?

Hey Jason, thank you for the fast reply. I saw it in this thread that apparently codegen is required to host on cloudflare: Deploying Next.js app with page routing.
I tried it out with both codegen and headless loader, but somehow I was always running into an issue. Cloudflare apparently needs an adapter (workers) to work with next js. I switched to AWS amplify now and it literally worked within 5 minutes :slight_smile:

Glad it worked! Yes codegen should work as well, but for most sites I would generally recommend loader for a simpler build/deploy process.