#Nuxt 3 vrs 4 layers

3 messages · Page 1 of 1 (latest)

main river
#

Can a Nuxt 4 repo be used as a layer for a Nuxt 3 project?

unreal kindleBOT
#

Hi @main river. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

There’s no explicit statement in the sources about mixing Nuxt 3 and Nuxt 4 across layers, so the following is based only on what is documented and is therefore uncertain.

From the available material, Nuxt layers are described as “partial Nuxt applications” that you extend from your main app, and the focus is on structuring and reusing code within the same Nuxt ecosystem (same generation of Nuxt) rather than mixing framework majors. [Nuxt layers video]

Nuxt 4 introduces a new directory structure (top-level app/, layers/, etc.) and other breaking changes compared to Nuxt 3. [Nuxt 4 folder structure] Because of these structural and compatibility differences, using a Nuxt 4 repo as a layer inside a Nuxt 3 project is very likely to run into issues, but the sources do not clearly confirm whether it is officially supported or explicitly forbidden.

So, based on the provided information:

  • Nuxt layers are supported and useful within a given Nuxt major version. [Nuxt layers video]
  • Nuxt 4 has a different, recommended directory structure and other breaking changes from Nuxt 3. [Nuxt 4 folder structure]
  • There is no clear documentation in these sources that a Nuxt 4 repo can safely be used as a layer in a Nuxt 3 app.

Given that, I cannot confidently say that a Nuxt 4 repo can be used as a layer for a Nuxt 3 project; the knowledge sources do not provide enough information to treat that as a supported setup.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: