Skip to content

Nuxt 4 implementation - plugin defaults to Nuxt 2 #2019

Description

@mrvanwagoner

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

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions