Skip to content

fix: error on failed getPrerenderPaths instead of silent warning - #14

Closed
hyfdev wants to merge 3 commits into
mainfrom
fix/prerender-hard-error
Closed

hyfdev wants to merge 3 commits into
mainfrom
fix/prerender-hard-error

Conversation

@hyfdev

@hyfdev hyfdev commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Changes collectPrerenderPaths to throw a hard error instead of console.warn when getPrerenderPaths fails to resolve
  • Applies to both pages mode and custom SSR mode

If a user explicitly exports getPrerenderPaths and it fails (e.g. unresolved virtual module, missing alias), the build should fail with a clear error — not silently skip the page and produce missing HTML files.

🤖 Generated with Claude Code

If a user exports getPrerenderPaths and it fails to resolve (e.g.
missing virtual module, unresolved alias), the build should fail
with a clear error instead of silently skipping the page.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 3, 2026 01:55
@hyfdev hyfdev changed the title fix: error on failed getPrerenderPaths instead of silent warning fix: error on failed ·getPrerenderPaths· instead of silent warning Mar 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown

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 makes prerender path collection fail the build when a user-defined getPrerenderPaths cannot be resolved or throws, instead of silently warning and continuing (applies to both pages-mode dynamic routes and custom SSR mode).

Changes:

  • Replace console.warn with thrown errors for failures while resolving dynamic page prerender paths.
  • Replace console.warn with thrown errors for failures while resolving custom SSR prerender paths.

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

Comment thread packages/void/src/prerender-paths.ts
Comment thread packages/void/src/prerender-paths.ts
Comment thread packages/void/src/prerender-paths.ts
@hyfdev hyfdev changed the title fix: error on failed ·getPrerenderPaths· instead of silent warning fix: error on failed getPrerenderPaths instead of silent warning Mar 3, 2026
hyfdev and others added 2 commits March 3, 2026 10:18
Address PR review feedback:
- Use `new Error(msg, { cause: err })` to preserve original stack trace
- Restore `[void]` prefix for consistency with other errors in the package
- Add unit tests for getPrerenderPaths failure scenarios

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@hyfdev

hyfdev commented Mar 3, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #16 — console.warn → throw change consolidated there.

@hyfdev hyfdev closed this Mar 3, 2026
@cpojer
cpojer deleted the fix/prerender-hard-error branch May 7, 2026 07:54
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.

2 participants