Skip to content

fix(llms): use a raw markdown route that rou3 accepts - #3928

Merged
farnabaz merged 1 commit into
mainfrom
fix/raw-route-rou3
Nov 24, 2026
Merged

farnabaz merged 1 commit into
mainfrom
fix/raw-route-rou3

Conversation

@danielroe

Copy link
Copy Markdown
Member

🔗 Linked issue

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 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)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

when testing a project on Nitro v3 (the Nuxt 4.7 opt-in, and the default in Nuxt 5), nuxt prepare fails as soon as the llms integration is enabled:

 ERROR  rou3: invalid param name "slug.md" (/raw/**:slug.md)

that's because rou3 1.0 ends a param name at the first character that isn't a letter, digit or underscore, which means **:slug.md isn't a valid route there. radix3 accepts it and names the param slug.md, which is why it's been fine on Nitro 2.

this PR registers the raw markdown handler on /raw/**:slug for Nitro 3, and both handlers read the path from either param name.

on Nitro 2 we keep the old route for now. with the new one, addServerHandler in kit 4.6.4 also registers the handler on /raw itself, so a page at /raw would start returning a 404. that's fixed in nuxt/nuxt#37155 and I've left a TODO to drop the special case once we require a kit release that includes it.

responses from a small docs project
url Nitro 2, v3.17.0 Nitro 2, this PR Nitro 3, this PR
/raw/en/getting-started.md 200 markdown 200 markdown 200 markdown
/raw/index.md 200 markdown 200 markdown 200 markdown
/raw/missing.md 404 404 404
/raw/en/getting-started 404 404 404
/raw 200 page 200 page 200 page
/llms.txt 200 200 200

with v3.17.0, the Nitro 3 build fails with the error above.

📝 Checklist

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

@vercel

vercel Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
content Ready Ready Preview Nov 22, 2026 10:40pm UTC

Request Review

@pkg-pr-new

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

Copy link
Copy Markdown
npm i https://pkg.pr.new/@nuxt/content@3928

commit: 75ebbc3

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The LLMS module now selects the raw Markdown route pattern by Nitro version. Both route handlers use params.slug when defined and otherwise use params['slug.md']. Unit tests cover Nitro 2 and Nitro 3 routing, including the /raw renderer fallback. The development dependencies now include rou3.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: Minimal · up to 75ebb

This change lets the llms integration work on Nitro 3 by using a route that rou3 accepts, and keeps the existing route on Nitro 2. No merge-blocking risk was identified, and tests cover the main routing paths.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title describes the main change: the raw markdown route is changed so that rou3 accepts it. The change is a bug fix for Nitro 3, which the title states in general terms. The title follows the conv…
Description check Passed The description explains the bug, the rou3 error, the new route for Nitro 3, the retained Nitro 2 route, the kit 4.6.4 special case, and a table of test responses. It relates directly to the changeset…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title describes the main change: the raw markdown route is changed so that rou3 accepts it. The change is a bug fix for Nitro 3, which the title states in general terms. The title follows the conventional commit format and matches the changeset.

Full details: Description check

Explanation

The description explains the bug, the rou3 error, the new route for Nitro 3, the retained Nitro 2 route, the kit 4.6.4 special case, and a table of test responses. It relates directly to the changeset.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • 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.

Share

Recent review info

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: b65f8cf7-dee6-41f5-91a3-69a10e8bb440
Commits

Reviewing files that changed from the base of the PR and between 6642158 and 75ebbc3.

Files ignored due to path filters: 1

  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing: 1

  • src/features/llms/module.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

@farnabaz
farnabaz merged commit a71cb98 into main Nov 24, 2026
9 checks passed
vinayakkulkarni added a commit to vinayakkulkarni/nxui that referenced this pull request Nov 25, 2026
Add nitro 3.0.261103-rc, so Nuxt 4.7 builds the server with Nitro v3.

- Server routes and middleware import from nuxt/server and read the
  request through event.req, event.url and event.res.headers; h3 and
  nitropack are no longer direct dependencies.
- The registry lookup reads the Workers ASSETS binding from
  event.req.runtime.cloudflare (Nitro v3) or event.context.cloudflare.
- Drop the static Content-Security-Policy route rule: Nitro v3 applies
  rule headers after the handler, so it replaced nuxt-security's
  per-request nonce CSP on every worker-rendered page.
- Patch @nuxt/content 3.17.0 with the fix from nuxt/content#3928: its
  /raw/**:slug.md route is invalid for rou3.
- Run dev in a node worker; the Miniflare dev runner cannot start the
  app yet (nitrojs/nitro#4621).

Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>

This branch was successfully deployed

1 active deployment
Preview — 75ebbc31 Deployed Nov 22, 2026 by vercel[bot]
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