Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix(nuxt): don't inject shared types for differing auto-imports#34191

Merged
danielroe merged 1 commit intomainnuxt/nuxt:mainfrom
fix/shared-typesnuxt/nuxt:fix/shared-typesCopy head branch name to clipboard
Jan 27, 2026
Merged

fix(nuxt): don't inject shared types for differing auto-imports#34191
danielroe merged 1 commit intomainnuxt/nuxt:mainfrom
fix/shared-typesnuxt/nuxt:fix/shared-typesCopy head branch name to clipboard

Conversation

@danielroe
Copy link
Copy Markdown
Member

🔗 Linked issue

resolves #34140

📚 Description

this filters out imports with differing implementations, and adds 'safe' declarations for certain key nuxt imports.

@danielroe danielroe requested a review from cernymatej January 27, 2026 13:08
@danielroe danielroe self-assigned this Jan 27, 2026
@bolt-new-by-stackblitz
Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 27, 2026

Walkthrough

Changes to the shared-imports generation logic in packages/nuxt/src/imports/module.ts restrict adding imports to sharedImports only when the import source matches the nitro import source, replacing the previous unconditional behaviour. A set of handcrafted global utility declarations for useRuntimeConfig, useAppConfig, defineAppConfig, createError, and setResponseStatus is introduced and injected into the generated global type augmentation alongside shared imports. Test coverage is expanded in test/fixtures/basic-types/shared/shared-types.ts with new assertions verifying that runtime config access functions are properly typed rather than any. No public API signatures are modified.

Possibly related PRs

🚥 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 accurately describes the main change: restricting shared type injection to imports with matching sources, which directly addresses the issue of differing auto-imports being injected.
Description check ✅ Passed The description is directly related to the changeset, explaining that it filters out imports with differing implementations and adds safe declarations for key Nuxt imports.
Linked Issues check ✅ Passed The changes implement the core fix for issue #34140 by restricting shared imports to those with matching sources and adding safe declarations for key utilities, preventing app/nitro-specific implementations from being injected into shared type context.
Out of Scope Changes check ✅ Passed All changes are in scope: the module.ts modification restricts import injection and adds handcrafted global declarations, while test additions verify the fix works correctly for useRuntimeConfig and useAppConfig.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/shared-types

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 and usage tips.

@github-actions github-actions Bot added 4.x 🐛 bug Something isn't working as expected labels Jan 27, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jan 27, 2026

Open in StackBlitz

@nuxt/kit

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

@nuxt/nitro-server

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

nuxt

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

@nuxt/rspack-builder

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

@nuxt/schema

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

@nuxt/vite-builder

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

@nuxt/webpack-builder

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

commit: 04a64c1

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Jan 27, 2026

Merging this PR will not alter performance

✅ 10 untouched benchmarks


Comparing fix/shared-types (04a64c1) with main (7ffcd60)

Open in CodSpeed

@danielroe danielroe merged commit ccfe10c into main Jan 27, 2026
55 checks passed
@danielroe danielroe deleted the fix/shared-types branch January 27, 2026 14:33
@github-actions github-actions Bot mentioned this pull request Jan 27, 2026
@github-actions github-actions Bot mentioned this pull request Feb 6, 2026
This was referenced Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tsconfig.shared.json ends up checking app and nitro context too

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.