Skip to main content
Next.js is open source and welcomes contributions from the community. This page walks you through setting up your environment, making changes, and opening a pull request.
Before jumping into a PR, search existing issues and pull requests to avoid duplicating work. There is also a 40-minute walkthrough video that covers the contribution process end to end.

Development branch

All development happens on the canary branch. Open pull requests against canary, not main. Changes on canary are published to npm under the @canary tag regularly.

Setting up your environment

1

Install dependencies

You need Node.js and pnpm. Enable pnpm with Corepack:
corepack enable pnpm
Optionally, install fnm or nvm to use the exact Node.js version specified in .node-version.
2

Clone the repository

Use a blobless clone for speed:
gh repo clone vercel/next.js -- --filter=blob:none --single-branch

# or via HTTPS
git clone https://github.com/vercel/next.js.git --filter=blob:none --single-branch
3

Install Node.js packages

pnpm install
4

Start the watch build

Start a background watch process that recompiles Next.js on every file change:
pnpm dev
This is much faster than a full build during iteration (~1–2 seconds per change vs ~60 seconds for a full build).
5

Create a branch

git switch --create my-feature-branch

Building

You can build the full project (TypeScript + Webpack bundling + type definitions) with:
pnpm build
To build both JavaScript and Rust code (required after switching branches or when touching Turbopack):
pnpm build-all
For type errors only (faster than a full build):
pnpm --filter=next types
If you modify Rust code, build new native bindings with:
pnpm swc-build-native

Running tests

Build the project before running tests for the first time:
pnpm build
Next.js has several test modes:
pnpm test-dev-turbo test/e2e/app-dir/app/
End-to-end tests run in complete isolation: a local version of Next.js is packed and installed in a temporary directory, a server is started on a random port, and the directory is cleaned up after the suite finishes.
Skip the isolation step with NEXT_SKIP_ISOLATE=1 for faster iteration, but do not use this flag when verifying module resolution or new package exports — it hides resolution failures that only appear when Next.js is installed as a real npm package.

Generating a new test

Use the interactive generator to scaffold a new test suite from a template:
pnpm new-test
For non-interactive use (for example, in scripts):
# pnpm new-test -- --args <appDir> <name> <type>
# appDir: true/false
# type: e2e | production | development | unit
pnpm new-test -- --args true my-feature e2e

Making a pull request

1

Run linting and formatting

pnpm prettier-fix
pnpm lint-fix
2

Commit your changes

git add .
git commit -m "describe your changes"
3

Open a PR with the GitHub CLI

gh pr create
This forks the repository and sets up a remote branch automatically.
The Next.js or Developer Experience team will review your changes, leave feedback, and merge when the PR is ready.

Contribution areas

Core

Bug fixes, new features, and performance improvements to the framework runtime.

Documentation

Improving docs, fixing typos, and writing new sections.

Examples

Integrations with other tools and services.

Turbopack

The Rust-based bundler. Requires a Rust toolchain.

Good first issues

Look for issues labeled good first issue on GitHub. These are scoped tasks that are well-suited for new contributors.

Code of conduct

All contributors are expected to follow the Next.js Code of Conduct. We are committed to maintaining a welcoming and respectful community.

Build docs developers (and LLMs) love