You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(prerender): report failed routes in prerender error - #5166
π Documentation (updates to the documentation, readme, or JSdoc annotations)
π Bug fix (a non-breaking change that fixes an issue)
π Enhancement (improving an existing functionality like performance)
β¨ New feature (a non-breaking change that adds functionality)
π§Ή Chore (updates to the build process or auxiliary tools and libraries)
β οΈ Breaking change (fix or feature that would cause existing functionality to change)
π Description
when prerendering fails with prerender.failOnError enabled, the build ends with:
[nitro]
Errors prerendering:
[nitro] ββ /broken (50ms)
β βββ [500] boom
[nitro]
ERROR Exiting due to prerender errors.
at prerender (.../node_modules/nitro/dist/_chunks/nitro4.mjs:305:9)
the message doesn't name the routes that failed or say what to do about them, and the stack points into nitro internals rather than the user's code.
this PR makes that error list the failing routes and their statuses, and mention the ways out: fix the route, add it to prerender.ignore, add its status code to prerender.ignoreStatusCodes, or set prerender.failOnError to false. it also collapses the error's stack to its name and message, for this throw and the Prerendered 0 routes throw that has the same problem.
No actionable comments were generated in the recent review.
Walkthrough
Prerender failures now use a shared error helper. Failure messages include a count, failed-route details, and remediation options. Tests check error messages, collapsed stacks, and route status reporting.
Changes: Prerender error reporting
Layer / File(s)
Summary
Failure messages and validation src/prerender/prerender.ts, test/prerender/fail-on-error.test.ts
The failure paths use a shared helper that limits the error stack to its name and message. When failOnError is enabled, the error message includes failed-route details and remediation options. Tests check route status reporting and ignored routes.
nitrojs/nitro#2906 β The error message includes fail-on-error configuration guidance. The issue also asks for crawler and concurrency settings, which this change does not address.
Suggested labels:prerender, bug
Merge Risk: Minimal Β· up to af3f1
This improves the prerender failure message by listing failed routes and suggesting remediation options. It only changes error text and stack output, so the risk of merging is minimal.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "fix(prerender): report failed routes in prerender error" follows the Conventional Commits format with a valid type (fix) and scope (prerender). It matches the main change: the prerender errβ¦
Description check
The description explains the problem with the current prerender error under failOnError. It lists the planned changes: naming failed routes and statuses, adding remediation options, and collapsing theβ¦
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "fix(prerender): report failed routes in prerender error" follows the Conventional Commits format with a valid type (fix) and scope (prerender). It matches the main change: the prerender error now names the failed routes and their statuses.
Full details: Description check
Explanation
The description explains the problem with the current prerender error under failOnError. It lists the planned changes: naming failed routes and statuses, adding remediation options, and collapsing the stack for the throw and the Prerendered 0 routes throw. This matches the changeset.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Fix failing CI checks
Create a new PR
Autofix Β· Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: eafaebbd-fedf-471a-beb5-d7fe32c9d992
Commits
Reviewing files that changed from the base of the PR and between 571aade and af3f1e0.
Files selected for processing: 2
src/prerender/prerender.ts
test/prerender/fail-on-error.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
π Linked issue
β Type of change
π Description
when prerendering fails with
prerender.failOnErrorenabled, the build ends with:the message doesn't name the routes that failed or say what to do about them, and the stack points into nitro internals rather than the user's code.
this PR makes that error list the failing routes and their statuses, and mention the ways out: fix the route, add it to
prerender.ignore, add its status code toprerender.ignoreStatusCodes, or setprerender.failOnErrortofalse. it also collapses the error's stack to its name and message, for this throw and thePrerendered 0 routesthrow that has the same problem.π Checklist