Skip to content

fix(presets): keep srvx/body-limit out of the bare srvx alias in standard - #4538

Merged
pi0 merged 1 commit into
nitrojs:mainfrom
ShreeBohara:fix/srvx-body-limit-alias
Aug 19, 2026
Merged

fix(presets): keep srvx/body-limit out of the bare srvx alias in standard#4538
pi0 merged 1 commit into
nitrojs:mainfrom
ShreeBohara:fix/srvx-body-limit-alias

Conversation

@ShreeBohara

Copy link
Copy Markdown
Contributor

🔗 Linked issue

Not a separate issue. This is what #4521 is failing on.

❓ Type of change

  • 🐞 Bug fix (a non-breaking change that fixes an issue)

📚 Description

The standard preset aliases bare srvx to srvx/generic. That alias prefix-matches, so any subpath resolves against the generic adapter's file instead of the package. The srvx/node, srvx/generic and srvx/tracing entries sitting next to it are there to work around exactly that.

srvx 0.12 adds a ./body-limit export and h3 imports it, so on any branch that bumps srvx the build dies:

[UNLOADABLE_DEPENDENCY] Could not load .../srvx@0.12.5/node_modules/srvx/dist/adapters/generic.mjs/body-limit
  from:  import { limitRequestBody } from "srvx/body-limit";

Adding the entry fixes it. On #4521's dependency set that takes the suite from 116 failures to 100; the remaining 100 are unrelated to this (mostly basic-auth assertions that need updating for h3 now sending charset="UTF-8", plus the bundle size budgets).

On main this changes nothing, since srvx 0.11 has no body-limit export and nothing imports it. Full suite on main with the patch is unchanged at 903 passing, with the one pre-existing bump-version date failure.

📝 Checklist

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

The `standard` preset aliases bare `srvx` to `srvx/generic`. That alias
prefix-matches, so subpaths resolve against the generic adapter's file rather
than the package, which is why `srvx/node`, `srvx/generic` and `srvx/tracing`
are already listed explicitly.

srvx 0.12 adds a `./body-limit` export and h3 imports it, so without an entry
`srvx/body-limit` resolves to `dist/adapters/generic.mjs/body-limit` and the
build fails with UNLOADABLE_DEPENDENCY.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ShreeBohara
ShreeBohara requested a review from pi0 as a code owner August 19, 2026 01:13
@vercel

vercel Bot commented Aug 19, 2026

Copy link
Copy Markdown

@ShreeBohara 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 Aug 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b446e735-2ac0-49a1-a094-bbf37c7da9ac

📥 Commits

Reviewing files that changed from the base of the PR and between 83030ab and 8907649.

📒 Files selected for processing (1)
  • src/presets/standard/preset.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The standard Nitro preset now aliases srvx/body-limit to itself.

Changes

Standard preset alias

Layer / File(s) Summary
Add body-limit alias
src/presets/standard/preset.ts
The standard preset configuration adds the srvx/body-limit self-alias.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 89076

This localized preset change corrects subpath resolution for the body-limit export; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Title check ✅ Passed The title follows the Conventional Commits format and accurately describes the preset alias fix.
Description check ✅ Passed The description directly explains the alias resolution bug, its impact, and the applied fix.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands.

@pi0 pi0 changed the title fix(presets): keep srvx/body-limit out of the bare srvx alias fix(standard preset): keep srvx/body-limit out of the bare srvx alias Aug 19, 2026
@pi0 pi0 changed the title fix(standard preset): keep srvx/body-limit out of the bare srvx alias fix(presets): keep srvx/body-limit out of the bare srvx alias in standard Aug 19, 2026
@pkg-pr-new

pkg-pr-new Bot commented Aug 19, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/nitro@4538

commit: 8907649

@pi0
pi0 merged commit 3f94b7e into nitrojs:main Aug 19, 2026
12 of 13 checks passed
@pi0 pi0 mentioned this pull request Aug 21, 2026
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