pinia-orm icon indicating copy to clipboard operation
pinia-orm copied to clipboard

Nuxt 4 implementation - plugin defaults to Nuxt 2

Open mrvanwagoner opened this issue 3 months ago • 0 comments

Environment

The addPlugin() method has the following code addPlugin(resolver.resolve("./runtime/plugin.vue" + (isNuxt3() ? "3" : "2")).... So when using Nuxt 4 it defaults to Nuxt 2.

Apparently, @nuxt/kit is deprecating isNuxt2 and isNuxt3 for isNuxtMajorVersion().

So for the above code to work with Nuxt 4 this seems to work: addPlugin(resolver.resolve('./runtime/plugin.vue' + (isNuxtMajorVersion(2) ? '2' : '3')).... That way any Nuxt version other than 2 will resolve to the plugin plugin.vue3.js which seems to work with Nuxt 4.

The other question however, would be what about the new folder structure in Nuxt 4? How might that impact @pinia-orm/nuxt?

Reproduction

See above.

Describe the bug

See above

Additional context

No response

Logs


mrvanwagoner avatar Oct 30 '25 22:10 mrvanwagoner