Skip to content

fix(nitro): keep server auto-import scanning - #35938

Merged
danielroe merged 3 commits into
mainfrom
scan-imports
Aug 2, 2026
Merged

danielroe merged 3 commits into
mainfrom
scan-imports

Conversation

@danielroe

Copy link
Copy Markdown
Member

🔗 Linked issue

📚 Description

this temporarily (?) re-enables scanning for server/ auto imports (and supports #imports alias) even when experimental.nitroAutoImports is off (which effectively turns off auto-importing h3)

@github-actions github-actions Bot added 5.x 🐛 bug Something isn't working as expected labels Aug 2, 2026
@coderabbitai

coderabbitai Bot commented Aug 2, 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: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e7135e47-8994-4a4e-93ef-a2c9c3470147

📥 Commits

Reviewing files that changed from the base of the PR and between beef786 and b5ebd45.

📒 Files selected for processing (11)
  • packages/nitro-server/src/augments.ts
  • packages/nitro-server/src/index.ts
  • packages/nitro-server/src/runtime/context.ts
  • packages/nitro-server/src/runtime/handlers/renderer.ts
  • packages/nitro-server/src/runtime/middleware/base-url.ts
  • packages/nitro-server/src/runtime/middleware/no-ssr.ts
  • packages/nitro-server/src/runtime/utils/app-config.ts
  • packages/nitro-server/src/runtime/utils/renderer/app.ts
  • packages/nitro-server/src/runtime/utils/renderer/dev-client-css.ts
  • packages/nitro-server/src/runtime/utils/renderer/dev-css.ts
  • packages/nuxt/test/shared-dir-config.test.ts
🚧 Files skipped from review as they are similar to previous changes (11)
  • packages/nitro-server/src/runtime/middleware/no-ssr.ts
  • packages/nitro-server/src/runtime/utils/app-config.ts
  • packages/nitro-server/src/index.ts
  • packages/nitro-server/src/runtime/utils/renderer/dev-css.ts
  • packages/nitro-server/src/runtime/context.ts
  • packages/nitro-server/src/runtime/utils/renderer/app.ts
  • packages/nitro-server/src/runtime/utils/renderer/dev-client-css.ts
  • packages/nuxt/test/shared-dir-config.test.ts
  • packages/nitro-server/src/runtime/middleware/base-url.ts
  • packages/nitro-server/src/runtime/handlers/renderer.ts
  • packages/nitro-server/src/augments.ts

Walkthrough

Nitro configuration now always provides an imports object. Auto-import options, directories, runtime imports, and exclusions remain configured, while presets remain conditional. Nitro now defines and re-exports NuxtRequestContext, augments srvx and h3 request contexts, and loads the shared context module across runtime modules. Renderer error-cause assignment now uses an explicit SerializedErrorCause cast. Tests verify directories remain registered without presets when compatibility auto-imports are disabled.

Possibly related PRs

  • nuxt/nuxt#35604: Modifies Nitro runtime context handling and renderer utilities for dev CSS propagation.
  • nuxt/nuxt#35605: Shares Nitro configuration, augmentation, and runtime changes for source-based type resolution and context typings.
  • nuxt/nuxt#35783: Modifies Nitro auto-import configuration and tests for disabled compatibility auto-imports.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: preserving server auto-import scanning in Nitro.
Description check ✅ Passed The description explains the changes to server auto-import scanning and the #imports alias when Nitro auto-imports are disabled.
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.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch scan-imports

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.

@pkg-pr-new

pkg-pr-new Bot commented Aug 2, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@nuxt/kit

npm i https://pkg.pr.new/@nuxt/kit@35938

@nuxt/nitro-server

npm i https://pkg.pr.new/@nuxt/nitro-server@35938

nuxt

npm i https://pkg.pr.new/nuxt@35938

@nuxt/rspack-builder

npm i https://pkg.pr.new/@nuxt/rspack-builder@35938

@nuxt/schema

npm i https://pkg.pr.new/@nuxt/schema@35938

@nuxt/vite-builder

npm i https://pkg.pr.new/@nuxt/vite-builder@35938

@nuxt/webpack-builder

npm i https://pkg.pr.new/@nuxt/webpack-builder@35938

commit: b5ebd45

@codspeed

codspeed Bot commented Aug 2, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 21 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing scan-imports (b5ebd45) with main (c6a7d2b)

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

5.x 🐛 bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant