Skip to content

Conversation

@karlhorky
Copy link
Contributor

@karlhorky karlhorky commented Jan 14, 2026

What?

Fix error with Netlify not finding pnpm create-next-app build output (when users use pnpm)

Also, remove unnecessary configuration, since pnpm v9 and v10 docs mention that the root package is always included:

The root package is always included, even when custom location wildcards are used.

For pnpm v9 (eg. latest version 9.15.9), the packages: [] cannot be entirely removed, because pnpm will error out with the message packages field missing or empty:

$ pnpm i
 ERROR  packages field missing or empty
For help, run: pnpm help install

Why?

When packages is set to a single item with ., Netlify infers the build command as pnpm --filter <package name from root package.json> build

$ pnpm --filter repro-pkg-name build
No projects matched the filters in "/Users/k/p/repro"
$ echo $?
0

How?

Change packages config from single item with . to an empty array, which causes Netlify to infer pnpm build as the command

cc @eps1lon

Copilot AI review requested due to automatic review settings January 14, 2026 15:37
@nextjs-bot nextjs-bot added the create-next-app Related to our CLI tool for quickly starting a new Next.js application. label Jan 14, 2026
@nextjs-bot
Copy link
Collaborator

nextjs-bot commented Jan 14, 2026

Allow CI Workflow Run

  • approve CI run for commit: 1ea04e9

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

Copy link
Member

@eps1lon eps1lon left a comment

Choose a reason for hiding this comment

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

Thanks!

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a Netlify build issue by modifying the pnpm-workspace.yaml configuration generated by create-next-app. The change updates the packages field from a single-item array containing . to an empty array [], which causes Netlify to correctly infer pnpm build as the build command instead of pnpm --filter <package name> build.

Changes:

  • Modified pnpm-workspace.yaml generation to use packages: [] instead of packages:\n - .
  • Simplified the configuration while maintaining compatibility with pnpm v9 (which requires the packages field) and v10

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@eps1lon
Copy link
Member

eps1lon commented Jan 14, 2026

Allow CI Workflow Run

  • approve CI run for commit: 1ea04e9

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

naveenkarmegam
naveenkarmegam previously approved these changes Jan 14, 2026
@eps1lon eps1lon changed the title Avoid error with out-of-box Netlify config [cna] Avoid error with out-of-box Netlify config Jan 14, 2026
@eps1lon eps1lon merged commit b8161d9 into vercel:canary Jan 14, 2026
362 of 399 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

create-next-app Related to our CLI tool for quickly starting a new Next.js application.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants