N
Nuxt19h ago
justin

Are certain properties of the layer nuxt.config.ts ignored?

My Nuxt Layer has defined the following in nuxt.config.ts
future: {
compatibilityVersion: 4,
},
future: {
compatibilityVersion: 4,
},
When I extend this layer in my project however, it doesn't seem that it is taking this config into account. I have to redefine this one in my project for it to treat my project as Nuxt 4.
2 Replies
kapa.ai
kapa.ai19h ago
Hi @justin. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Yes, you are correct in observing that certain properties of the layer's nuxt.config.ts seem to be ignored, specifically the future.compatibilityVersion setting. This is a known behavior with layers and the compatibilityVersion feature flag. According to the Nuxt documentation on upgrading, there's an important note regarding this: "For now, you need to define the compatibility version in each layer that opts into Nuxt 4 behavior. This will not be required after Nuxt 4 is released." This means that when using layers, you currently need to set the compatibilityVersion in both your layer's nuxt.config.ts and in your project's nuxt.config.ts for it to take effect properly. This behavior is temporary and is expected to change once Nuxt 4 is officially released. For now, to ensure your project is treated as Nuxt 4, you should include the compatibilityVersion setting in your project's configuration as well. Nuxt Upgrade Guide provides more details on how to opt into Nuxt 4 behavior and the current limitations with layers. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai19h ago
<@443850898020761600> Kapa.ai is still learning and improving, please let me know how I did by reacting below.

Did you find this page helpful?