Skip to content

eval next.config export functions in the try catch#93884

Open
lukesandberg wants to merge 2 commits into
canaryfrom
config_eval_throw_bad_message
Open

eval next.config export functions in the try catch#93884
lukesandberg wants to merge 2 commits into
canaryfrom
config_eval_throw_bad_message

Conversation

@lukesandberg
Copy link
Copy Markdown
Contributor

@lukesandberg lukesandberg commented May 16, 2026

Move next.config evaluation inside the try catch where we import and transform it

This ensures we print an appropriate help link if the export function throws

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@lukesandberg lukesandberg marked this pull request as ready for review May 16, 2026 00:52
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 16, 2026

Notifying the following users due to files changed in this PR based on this repo's notify modifiers:

@timneutkens, @ijjk, @shuding, @huozhi:

packages/next/src/server/config.ts

@github-actions
Copy link
Copy Markdown
Contributor

Failing test suites

Commit: 35821c0 | About building and testing Next.js

pnpm test-start test/e2e/app-dir/next-after-app-static/build-time/build-time.test.ts (job)

  • after() in static pages > runs after during build (DD)
Expand output

● after() in static pages › runs after during build

can not run export while server is running, use next.stop() first

  251 |   ) {
  252 |     if (this.childProcess) {
> 253 |       throw new Error(
      |             ^
  254 |         `can not run export while server is running, use next.stop() first`
  255 |       )
  256 |     }

  at NextStartInstance.build (lib/next-modes/next-start.ts:253:13)
  at Object.build (e2e/app-dir/next-after-app-static/build-time/build-time.test.ts:36:36)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant