Skip to content

feat(prerender): expose linking pages on failed routes - #47

Merged
pi0 merged 4 commits into
nitrojs:mainfrom
danielroe:feat/prerender-linked-from
Nov 23, 2026
Merged

pi0 merged 4 commits into
nitrojs:mainfrom
danielroe:feat/prerender-linked-from

Conversation

@danielroe

@danielroe danielroe commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

🔗 Linked issue

nuxt/nuxt#37194
nuxt/cli#1662

❓ Type of change

  • 📖 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

backport of nitrojs/nitro#5167

Note

Upstream nitrojs/nitro#5167 is not merged yet. This should land once it ships in an upstream release (release link to be added).

we know which pages linked to each crawled route, and we print Linked from /about under failed routes in its error output.

this is really helpful, but once a consumer quiets the prerenderer to logLevel: 1 (as Nuxt does when it renders the build itself), the hint disappears even though the data is there.

so this exposes the linking pages on the route object so they can be read from the prerender:route and prerender:done hooks. In prerender:route the list only covers pages crawled so far; the complete list is in prerender:done.

it also fixes some v2 issues along the way:

  • link parents are now keyed by the decoded route, so encoded routes (e.g. /caf%C3%A9) show their parents
  • link parents are cleared per run, so they no longer leak between prerender() calls in the same process
  • removes the unused duplicate linkParents map in prerender.ts
  • links that fail to decode no longer abort link extraction

The only difference from upstream: v2 does not strip baseURL from crawled links (v2 does not strip it anywhere), so there's no withoutBase call.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

🤖 Generated with AI assistant

@danielroe
danielroe requested a review from pi0 as a code owner November 21, 2026 10:50
@vercel

vercel Bot commented Nov 21, 2026

Copy link
Copy Markdown

@danielroe is attempting to deploy a commit to the Nitro Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 43897af0-0c81-4e2b-a99e-90253e6806b5
  • 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.

Share

@pkg-pr-new

pkg-pr-new Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/nitropack@47

commit: 9da7ed1

@pi0
pi0 merged commit 01e45ca into nitrojs:main Nov 23, 2026
9 of 10 checks passed
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