Fails to run when extending from a remote layer
Environment
- Operating System: Windows_NT
- Node Version: v22.9.0
- Nuxt Version: 3.15.2
- CLI Version: 3.20.0
- Nitro Version: 2.10.4
- Package Manager: [email protected]
- Builder: -
- User Config: extends, compatibilityDate
- Runtime Modules: -
- Build Modules: -
Reproduction
Layer: https://github.com/Luca-Sett/test-layer Project extending layer: https://github.com/Luca-Sett/test-project
Describe the bug
We are seeing errors with v6.13 when trying to extend a remote Nuxt Layer which has the module installed.
Both dev & build show errors about not being able to find a merger file.
This worked in v6.12.2.
Additional context
No response
Logs
Thanks for reproduction - I will triage this within this week. Please do ping me if I do not update by then!
Hey @ineshbose, pinging!
Hey @ineshbose, pinging!
Of course - I had scheduled Saturday to triage this but I wasn't able to get to it. Thanks for the nudge and your patience 🙏
Seeing the directory structure, it seems that the remote layer gets cloned in node_modules/.c12, and then @nuxtjs/tailwindcss is installed within node_modules/.c12/layer/node_modules and there is no link to the base project node_modules causing this issue. I am inclined to believe that this may be a c12 or giget thing, for which I'd ping @pi0 /cc for expertise. 🙇
Meanwhile, there would be the workaround to add @nuxtjs/tailwindcss to your dependencies using:
npm i -D @nuxtjs/tailwindcss
Thanks for taking a look and for providing a workaround!
Dependencies of layers are isolated to themselves (like any normal dependency without shamefully-hoist). if we install them globally, it causes dependency conflict and implicit dep-tree. so this at least expected behavior from giget.
But @ineshbose can you please clarify better for issue? Why a dependency of layer is needed in project level imports?
Thanks for explaining!
But @ineshbose can you please clarify better for issue? Why a dependency of layer is needed in project level imports?
The dependency (module in this case) of a layer will generate templates in the build directory that will have imports to other module exports. In that case, it would be needed as a dependency to the project too I suppose
Has this issue been resolved with v7.0.0-beta.0? I tried it, but couldn't extend the classes, even from a local layer.
Edit: by local, I mean, in my computer but different project. Like:
extends: ['../my-layer'],