t4-app: Lucia branch: ERROR: Failed to produce a Cloudflare Pages build from the project. The route `/oauth/[provider]` was not configured to run with the Edge Runtime

When I run the CF-deploy GH action https://github.com/timothymiller/t4-app/blob/325b5e58a39bf9cd4019db6273ad6ce62889cf2d/.github/workflows/next.yml#L46 I get this error:

⚡️ Completed bunx vercel build.

⚡️ ERROR: Failed to produce a Cloudflare Pages build from the project. ⚡️ ⚡️ The following routes were not configured to run with the Edge Runtime: ⚡️ - /oauth/[provider] ⚡️ ⚡️ Please make sure that all your non-static routes export the following edge runtime route segment config: ⚡️ export const runtime = ‘edge’; ⚡️ ⚡️ You can read more about the Edge Runtime on the Next.js documentation: ⚡️ https://nextjs.org/docs/app/building-your-application/rendering/edge-and-nodejs-runtimes

Any idea why? It didn’t happen when I tried deploying the master branch a month ago…

About this issue

  • Original URL
  • State: open
  • Created 6 months ago
  • Comments: 15 (11 by maintainers)

Most upvoted comments

Sorry about this. I recently added handling apple oauth form posts and apparently never tested deploying to cloudflare. I must have only been running it locally.

I added some comments to the code to explain what it is doing there. Apple will POST form data to the redirect URI when scopes have been requested. https://developer.apple.com/documentation/sign_in_with_apple/request_an_authorization_to_the_sign_in_with_apple_server

Btw, I’m a big fan of your work on rust bindings for webview 😃

I’ve been trying to track this issue down this past week.

Does it work when you set the runtime to ‘experimental-edge’?