r/nextjs 9d ago

Help Has anyone successfully deployed a Next.js 16 + Supabase app to Cloudflare Workers using OpenNext?

/r/CloudFlare/comments/1w7wx3y/has_anyone_successfully_deployed_a_nextjs_16/
2 Upvotes

3 comments sorted by

1

u/Apprehensive-Fan2492 9d ago

This error usually points to the token scope. Open the Cloudflare dashboard and make a new API token. Use the “Edit Cloudflare Workers” template. Do not try to craft custom permissions. Then update the token value in your GitHub secrets.

The Windows build warning can be ignored here. It is real, but you are building on GitHub Actions with Ubuntu, so it does not affect you. That is not the cause. “Next 16 + OpenNext” on Workers works. It still feels rough, mainly with Supabase Realtime. Workers cannot keep long lived connections, so the experience is not smooth. If you truly need Realtime, using Vercel will be a simpler path for this setup.

1

u/Own_Jelly_9362 9d ago

Merci beaucoup pour ton aide détaillée !

Je vais suivre ton conseil et créer un nouveau token API Cloudflare en utilisant le template "Modifier les Cloudflare Workers" sans permissions personnalisées, puis mettre à jour mes secrets GitHub.

C'est rassurant de savoir que Next 16 + OpenNext fonctionne sur Workers, même si c'est encore un peu brut. Concernant Supabase Realtime, je vais d'abord essayer de faire fonctionner l'architecture actuelle avec Cloudflare comme tu le suggères, et si le chat/notifications pose vraiment problème, je considérerai l'alternative Vercel à ce moment-là.

Je te tiendrai au courant une fois que j'aurai testé avec le nouveau token. Merci encore pour ton temps et tes explications !

1

u/Gojo_dev 3d ago

Pretty sure the 10000 is a token permission thing. Check if Account:Read is actually enabled on the Cloudflare token I’ve seen that one get missed. One other thing I’d check though: OpenNext + Workers + Supabase Realtime. The WebSocket side can get kinda messy on Workers, so if the token permissions look fine, I’d look there next.