Loading...

How to run a website built with Next.js 15 on Cloudflare Pages?

question nextjs cloudflare
Ram Patra Published on March 19, 2025
Next.js 15+

If you simply connect a website’s code on GitHub with Cloudflare Pages that’s built using Next.js 15+, it may not build successfully out of the box. If this is the case with you, make sure to do the following.

Create a new .nvmrc file at the root of your project with this in it:

20 

Yes, it’s just the number 20. This specifies the node version to use.

Additionally, add the following to your package.json file:

"engines": {
  "node": ">=20.0.0"
}

That’s all you have to do. You do not have to change any commands on Cloudflare, etc. I built the website for SimpleFill using Next.js 15 and have deployed to Cloudflare Pages currently with no issues whatsoever.

Presentify

Take your presentation to the next level.

FaceScreen

Put your face and name on your screen.

ToDoBar

Your to-dos on your menu bar.

Ram Patra Published on March 19, 2025
Image placeholder

Keep reading

If this article was helpful, others might be too

question nextjs front-end November 12, 2024 How to define schemas, foreign keys, relations, and query data by performing joins in a Nextjs app using Supabase and Drizzle?

Drizzle is an ORM that makes it easy to work with db, data migrations, etc. Here’s how you can define foreign keys, relations, and perform table joins using Drizzle ORM in a Next.js app with Supabase:

question nextjs react July 18, 2024 How to programmatically navigate to a page in Next.js?

In Next.js, you can programmatically navigate to different pages using the useRouter hook from the next/navigation module. This hook provides a convenient way to navigate between pages within your Next.js application. Below is an example demonstrating how to use the useRouter hook to programmatically navigate to another page.

question nextjs react February 9, 2024 Main advantages of using the Link component in Next.js over Anchors and Buttons

The main advantage of using the Link component in Next.js for client-side navigation is its optimized prefetching behavior, which enhances the performance and user experience of your web application. Here’s a breakdown of the key advantages:

Like my work?

Please, feel free to reach out. I would be more than happy to chat.