Skip to content

fix: augment NitroRouteConfig on both nitropack module paths#295

Merged
harlan-zw merged 1 commit intomainfrom
fix/nitro-route-config-cross-module
Apr 23, 2026
Merged

fix: augment NitroRouteConfig on both nitropack module paths#295
harlan-zw merged 1 commit intomainfrom
fix/nitro-route-config-cross-module

Conversation

@harlan-zw
Copy link
Copy Markdown
Contributor

🔗 Linked issue

Resolves #294

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

Nuxt 4's @nuxt/kit types NitroRouteConfig as a union across both nitropack and nitropack/types. We were only augmenting one path, so consumers calling extendRouteRules saw our robots key disappear and native keys like ssr rejected as unknown. Now augments both module paths on Nuxt 4, with a regression test covering the exact kit v4 scenario from the issue.

Nuxt 4's @nuxt/kit unions NitroRouteConfig across both 'nitropack' and
'nitropack/types' via the v2/v3 split. Augmenting only one module path left
the other re-exporting an un-augmented interface, causing the `robots` key to
go missing and native keys like `ssr` to be rejected in extendRouteRules.

Augment both module paths on Nuxt 4 so consumers see the complete type.

Resolves #294
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 23, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@nuxtjs/robots@295

commit: c7c6bd4

@harlan-zw harlan-zw merged commit d042115 into main Apr 23, 2026
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.

fix: Type NitroRouteConfig misses ssr property

1 participant