Next.js Discord

Discord Forum

Page routes with cloudflare-pages

Answered
Manisha posted this in #help-forum
Open in Discord
Hai, I have been created my next js project in Page routes, using cloudflare for deployment, i have added “export const runtime =edge” in all non-static routes, but i have error “ use experimental-edge instead of edge” , so i changed it but still have deployment error.

Anyone help me to fix this.
Answered by joulev
@Manisha so i just tried deploying an app myself and it... just works?
View full answer

22 Replies

In the upgraded version, does it work with page routes
have been using the updated Next.js version, but edge is not supported in page routes.
@joulev It is. What is the error you are having?
Error: Page /auth/callback provided runtime 'edge', the edge runtime for rendering is currently experimental. Use runtime 'experimental-edge' instead.
@Manisha Error: Page /auth/callback provided runtime 'edge', the edge runtime for rendering is currently experimental. Use runtime 'experimental-edge' instead.
Are you sure you are using the latest version? What is the version in your node_modules?
In browser console type “next.version”, what does it show?
next@14.2.3
@Manisha 14.2.3
That’s weird. It should work: https://nextjs.org/docs/pages/building-your-application/data-fetching/get-server-side-props#edge-runtime

export const config = {
  runtime: 'edge'
}
yes, but it’s not working.
@Manisha yes, but it’s not working.
i see, it is indeed not working, tested just now. that's really odd.

try
export const config = {
  runtime: "experimental-edge",
};
// NOT export const runtime = "..."

on cloudflare pages, does it accept this runtime config?
if it still doesn't work then tough luck, i honestly have no idea how to deploy on cf pages. maybe open an issue over https://github.com/cloudflare/next-on-pages
meanwhile i have opened an issue on nextjs's side: https://github.com/vercel/next.js/issues/65945
@Manisha so i just tried deploying an app myself and it... just works?
Answer
nothing special on the nextjs app side. it just works
@joulev <@1206462535822352404> so i just tried deploying an app myself and it... just works?
thank you so much, deployed project successfully.