fix(nuxt): resolve vue3 runtime plugin on Nuxt 4 - #2026
Merged
Conversation
The module resolved the runtime plugin with isNuxt3(), so any Nuxt version other than 3 (including Nuxt 4) fell back to the Nuxt 2 plugin. Invert the check so only Nuxt 2 gets the vue2 plugin and every newer major resolves the vue3 plugin. fixes #2019
Closed
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 1.x #2026 +/- ##
=======================================
Coverage 99.44% 99.44%
=======================================
Files 86 86
Lines 3048 3048
Branches 531 531
=======================================
Hits 3031 3031
Misses 14 14
Partials 3 3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The module resolved its runtime plugin via
isNuxt3() ? '3' : '2', so any Nuxt major other than 3 — including Nuxt 4 — fell back to the Nuxt 2 plugin and the app broke.This inverts the check to
isNuxt2(nuxt) ? '2' : '3': only Nuxt 2 gets the vue2 plugin, every newer major (3, 4, …) resolves the vue3 plugin.isNuxtMajorVersion()is not available in the @nuxt/kit version pinned on 1.x (3.12.3, added in 3.13), so the still-supportedisNuxt2()is used instead. Onmain(v2) the module no longer has the vue2/vue3 split, so this only affects the 1.x line.Verified with a local
nuxt-module-build build.fixes #2019