Skip to content

[Pages] Include documentation for Node Version in nextjs/deploy-a-static-nextjs-site.mdx #22530

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: production
Choose a base branch
from

Conversation

schemburkar
Copy link

Included additional documentation for updating node version for a next.js static site using .nvmrc

Summary

Additional documentation to update Node.js version used is Cloudflare builds by default.

Recent Next.js versions require a minimum Node.js version to be used in builds. Most other documentation on specifying Node.js version applies to a full Next.js site. For a static website, the simplest approach is to update the .nvmrc file as Cloudflare builds use nvm for detection of node version

Fixes #22529

Screenshots (optional)

Documentation checklist

included additional documentation for updating node vversion for a next.js static site using .nvmrc
Copy link
Contributor

hyperlint-ai bot commented May 18, 2025

Howdy and thanks for contributing to our repo. The Cloudflare team reviews new, external PRs within two (2) weeks. If it's been two weeks or longer without any movement, please tag the PR Assignees in a comment.

We review internal PRs within 1 week. If it's something urgent or has been sitting without a comment, start a thread in the Developer Docs space internally.


PR Change Summary

Added documentation for specifying Node.js version in Next.js static site deployment.

  • Included instructions for creating a .nvmrc file to specify Node.js version
  • Clarified Node.js version requirements for Next.js builds
  • Updated documentation to address Cloudflare's default Node.js version handling

Modified Files

  • src/content/docs/pages/framework-guides/nextjs/deploy-a-static-nextjs-site.mdx

How can I customize these reviews?

Check out the Hyperlint AI Reviewer docs for more information on how to customize the review.

If you just want to ignore it on this PR, you can add the hyperlint-ignore label to the PR. Future changes won't trigger a Hyperlint review.

Note specifically for link checks, we only check the first 30 links in a file and we cache the results for several hours (for instance, if you just added a page, you might experience this). Our recommendation is to add hyperlint-ignore to the PR to ignore the link check for this PR.

@schemburkar schemburkar marked this pull request as ready for review May 18, 2025 09:03
Some Next.js projects have additional requirements for different Node.js versions.

```sh
You are using Node.js 18.17.1. For Next.js, Node.js version "^18.18.0 || ^19.8.0 || >= 20.0.0" is required.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this sh (rather than plain or text)?
Is it an error message?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, error message from build when not specifying a node version on a new default setup.
Reason Cloudflare defaults to 18.17.1 while NextJS defaults to minimum 18.18.0

Copy link
Contributor

@vicb vicb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's one way to force a version, there are other.

Not sure if that's something we should document? Is it not really related to Cloudflare?

@schemburkar
Copy link
Author

That's one way to force a version, there are other.

Not sure if that's something we should document? Is it not really related to Cloudflare?

yes I'm aware, although most other documentation only works for Cloudflare workers which is different than the Static NextJS setup for Cloudflare Pages.
And since any new NextJS setup for static website hosted on Cloudflare Pages will need this, thought it will be better to document the same.

Feel free to decide otherwise

@ToriLindsay ToriLindsay requested review from kodster28 and removed request for ToriLindsay June 6, 2025 11:31
@ToriLindsay ToriLindsay assigned kodster28 and unassigned ToriLindsay Jun 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Pages] Include documentation for Node Version in nextjs/deploy-a-static-nextjs-site.mdx
7 participants