Nuxt3 limitation on Layers & Modules

Rmag Breaking News

Nuxt is a good framework.

I’ve been using it for a few months now and it’s good, but I found some limitations that were annoying for a professional use.

Layers & modules

Nuxt’s Layers and modules allows you to split your code as reusable parts.

a layer for your shared UI components
a layer for your auth system

But each layer can requires specific packages for it’s business.

Limitation

With Nuxt <= 3.11.1 at least, if your layers/modules requires dependencies to work, Nuxt will not install these dependencies on npm install or npm build on your projects and you won’t be able to run em.

Documentation is very poor and unclear about theses two features.

Workaround

I tested a lot of tricks, asked the community but there is no workaround for now except manually install your layers’/modules’ dependencies into each one of your projects.

It’s very limitative and annoying if you want to use your layers/modules on several projects and this make it loses all the interest of these features: easy reusability.

Keep this in mind before starting a big and professional project with it. 😣

Leave a Reply

Your email address will not be published. Required fields are marked *