Next.js static page hosting with Cloudflare Pages

5 December 2024
Free hosting
frontend

1. Introduction

Working with Cloudflare Pages is easy. This blog document the 2 issues that I encountered during the deployment and how to fix them.

2. The solution

2.1: Issue with yarn version. Default version used by Cloudflare is not v1. If you are using yarn version 1, you need to specify it in package.json

  "packageManager": "[email protected]"

2.2: Issue with node version. To use the desired node version. Create a file .nvmrc and add the version.

In my case, my .nvmrc looks like this.

20

Now it should works!

Thanks for reading! Cheers!