Skip to content

fix(runtime-utils): insert compilerOptions conditionally#1659

Open
DerYeger wants to merge 1 commit intonuxt:mainfrom
DerYeger:main
Open

fix(runtime-utils): insert compilerOptions conditionally#1659
DerYeger wants to merge 1 commit intonuxt:mainfrom
DerYeger:main

Conversation

@DerYeger
Copy link
Copy Markdown

Prevents warning for Vue builds without a runtime compiler

🔗 Linked issue

Resolves #1658

📚 Description

Fixes a Vue warning if the Vue build does not include the compiler by only setting compiler options if they are non-empty.

Prevents warning for Vue builds without a runtime compiler
@DerYeger DerYeger requested a review from danielroe as a code owner April 12, 2026 05:25
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 12, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@nuxt/test-utils@1659
npm i https://pkg.pr.new/vitest-environment-nuxt@1659

commit: 243a07b

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 12, 2026

📝 Walkthrough

Walkthrough

The mergeComponentMountingGlobalOptions function in src/runtime-utils/utils/suspended.ts has been modified to conditionally include compilerOptions in the returned configuration object. The function now merges compilerOptions from both defaults.config?.compilerOptions and options.config?.compilerOptions, and only includes this property in the result when the merged object contains at least one key. Previously, compilerOptions was always included as an object through unconditional merging, even when both sources were undefined.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

🚥 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
Description check ✅ Passed The description clearly relates to the changeset by explaining the purpose of conditionally setting compilerOptions to prevent Vue runtime warnings.
Linked Issues check ✅ Passed The PR addresses issue #1658 by implementing the requested fix: conditionally including compilerOptions only when non-empty to prevent Vue's runtime-only build warning.
Out of Scope Changes check ✅ Passed The changes in suspended.ts are focused on the linked issue #1658, modifying only the compilerOptions merging logic without introducing unrelated modifications.
Title check ✅ Passed The title accurately describes the main change: conditionally inserting compilerOptions instead of always including it, which directly addresses the issue of Vue warnings.

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

✨ Finishing Touches
🧪 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 and usage tips.

@DerYeger DerYeger changed the title fix(runtime): inser compilerOptions conditionally fix(runtime): insert compilerOptions conditionally Apr 12, 2026
@danielroe danielroe changed the title fix(runtime): insert compilerOptions conditionally fix(runtime-utils): insert compilerOptions conditionally Apr 15, 2026
@danielroe danielroe changed the title fix(runtime-utils): insert compilerOptions conditionally fix(runtime-utils): insert compilerOptions conditionally Apr 15, 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.

Runtime warning due to compilerOptions

2 participants