Add to package.json
“pages:build“: “npx @cloudflare/next-on-pages“
Add this code to layout.js
export const runtime = “edge“;
Now, You can go to cloudflare dashboard and publish your application from Git Repository.
After deploy add nodejs_compat flag
Go to Settings -> Functions -> Compatibility flags
See Video
See :- https://developers.cloudflare.com/pages/framework-guides/nextjs/deploy-a-nextjs-site/