[PR #973] [MERGED] fix: support enablePrerenderSourceMaps config with default true #992

Closed
opened 2026-05-06 13:11:27 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/973
Author: @Divkix
Created: 4/29/2026
Status: Merged
Merged: 5/1/2026
Merged by: @james-elicx

Base: mainHead: fix/960-enable-prerender-sourcemaps


📝 Commits (6)

  • 331fda8 fix: support enablePrerenderSourceMaps config with default true (#960)
  • 9e3806a refactor: address review comments for enablePrerenderSourceMaps (#960)
  • 21f401f fix(prerender): simplify getErrorMessageWithStack and add test coverage
  • 6785e20 fix(prerender): address review feedback - update snapshot, add config comment
  • 48a5fcb feat(config): add enablePrerenderSourceMaps config option
  • e1e3087 Merge origin/main — resolve conflicts in next-config.ts and test

📊 Changes

9 files changed (+126 additions, -51 deletions)

View changed files

📝 packages/vinext/src/build/prerender.ts (+21 -3)
📝 packages/vinext/src/check.ts (+4 -0)
📝 packages/vinext/src/cli.ts (+7 -0)
📝 packages/vinext/src/config/next-config.ts (+10 -0)
📝 packages/vinext/src/deploy.ts (+4 -0)
📝 tests/__snapshots__/entry-templates.test.ts.snap (+51 -48)
tests/fixtures/pages-basic/pages/error-throw.tsx (+4 -0)
📝 tests/next-config.test.ts (+15 -0)
📝 tests/prerender.test.ts (+10 -0)

📄 Description

Fixes #960

Summary

Adds the enablePrerenderSourceMaps config option matching Next.js behavior:

  • Defaults to true — prerender error stack traces resolve through sourcemaps to original source files
  • Error results in prerender output now include full stack traces when enabled
  • Node.js sourcemap support (process.setSourceMapsEnabled(true)) is enabled before the prerender phase in both cli.ts (build) and deploy.ts (deploy)
  • Config is silently accepted and recognized as "supported" in vinext check output

Test plan

  • 3 new unit tests in tests/next-config.test.ts verifying default true, explicit false, and explicit true
  • All existing next-config.test.ts and prerender.test.ts tests continue to pass

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cloudflare/vinext/pull/973 **Author:** [@Divkix](https://github.com/Divkix) **Created:** 4/29/2026 **Status:** ✅ Merged **Merged:** 5/1/2026 **Merged by:** [@james-elicx](https://github.com/james-elicx) **Base:** `main` ← **Head:** `fix/960-enable-prerender-sourcemaps` --- ### 📝 Commits (6) - [`331fda8`](https://github.com/cloudflare/vinext/commit/331fda8a1b7a30d5c367c37dcc4c669037bb8913) fix: support enablePrerenderSourceMaps config with default true (#960) - [`9e3806a`](https://github.com/cloudflare/vinext/commit/9e3806a2ab19d0ebfa68781893f0bdeb239eeba9) refactor: address review comments for enablePrerenderSourceMaps (#960) - [`21f401f`](https://github.com/cloudflare/vinext/commit/21f401f88a9f62cbb14b7a1d61ab98c134983c75) fix(prerender): simplify getErrorMessageWithStack and add test coverage - [`6785e20`](https://github.com/cloudflare/vinext/commit/6785e20701e72da6b15de86722b2ddd80b3706f1) fix(prerender): address review feedback - update snapshot, add config comment - [`48a5fcb`](https://github.com/cloudflare/vinext/commit/48a5fcb7b3dda495f661afb595519f0416211e02) feat(config): add enablePrerenderSourceMaps config option - [`e1e3087`](https://github.com/cloudflare/vinext/commit/e1e30876f8524d93bd8e90529d0eace7e9aa64e3) Merge origin/main — resolve conflicts in next-config.ts and test ### 📊 Changes **9 files changed** (+126 additions, -51 deletions) <details> <summary>View changed files</summary> 📝 `packages/vinext/src/build/prerender.ts` (+21 -3) 📝 `packages/vinext/src/check.ts` (+4 -0) 📝 `packages/vinext/src/cli.ts` (+7 -0) 📝 `packages/vinext/src/config/next-config.ts` (+10 -0) 📝 `packages/vinext/src/deploy.ts` (+4 -0) 📝 `tests/__snapshots__/entry-templates.test.ts.snap` (+51 -48) ➕ `tests/fixtures/pages-basic/pages/error-throw.tsx` (+4 -0) 📝 `tests/next-config.test.ts` (+15 -0) 📝 `tests/prerender.test.ts` (+10 -0) </details> ### 📄 Description Fixes #960 ## Summary Adds the `enablePrerenderSourceMaps` config option matching Next.js behavior: - Defaults to `true` — prerender error stack traces resolve through sourcemaps to original source files - Error results in prerender output now include full stack traces when enabled - Node.js sourcemap support (`process.setSourceMapsEnabled(true)`) is enabled before the prerender phase in both `cli.ts` (build) and `deploy.ts` (deploy) - Config is silently accepted and recognized as "supported" in `vinext check` output ## Test plan - 3 new unit tests in `tests/next-config.test.ts` verifying default `true`, explicit `false`, and explicit `true` - All existing `next-config.test.ts` and `prerender.test.ts` tests continue to pass --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 13:11:27 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#992
No description provided.