tailwindcss icon indicating copy to clipboard operation
tailwindcss copied to clipboard

Fails to run when extending from a remote layer

Open Luca-Sett opened this issue 11 months ago • 7 comments

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


Luca-Sett avatar Jan 16 '25 13:01 Luca-Sett

Thanks for reproduction - I will triage this within this week. Please do ping me if I do not update by then!

ineshbose avatar Jan 28 '25 09:01 ineshbose

Hey @ineshbose, pinging!

Luca-Sett avatar Feb 03 '25 09:02 Luca-Sett

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

ineshbose avatar Feb 04 '25 08:02 ineshbose

Thanks for taking a look and for providing a workaround!

Luca-Sett avatar Feb 04 '25 09:02 Luca-Sett

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?

pi0 avatar Feb 04 '25 10:02 pi0

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

ineshbose avatar Feb 04 '25 10:02 ineshbose

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'],

ojvribeiro avatar May 26 '25 13:05 ojvribeiro