Page routes with cloudflare-pages
Answered
Manisha posted this in #help-forum
ManishaOP
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.
Anyone help me to fix this.
Answered by joulev
@Manisha so i just tried deploying an app myself and it... just works?
22 Replies
@Manisha 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.
upgrade nextjs to the latest version. then the edge runtime is fully stable, you don't need the "experimental" part
ManishaOP
In the upgraded version, does it work with page routes
@joulev upgrade nextjs to the latest version. then the edge runtime is fully stable, you don't need the "experimental" part
ManishaOP
In the upgraded version, does it work with page routes
ManishaOP
have been using the updated Next.js version, but edge is not supported in page routes.
@Manisha have been using the updated Next.js version, but edge is not supported in page routes.
It is. What is the error you are having?
@joulev It is. What is the error you are having?
ManishaOP
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?
ManishaOP
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'
}ManishaOP
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
on cloudflare pages, does it accept this runtime config?
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
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?
ManishaOP
thank you so much, deployed project successfully.