Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to run when extending from a remote layer #940

Open
Luca-Sett opened this issue Jan 16, 2025 · 6 comments
Open

Fails to run when extending from a remote layer #940

Luca-Sett opened this issue Jan 16, 2025 · 6 comments
Labels
bug Something isn't working has-workaround

Comments

@Luca-Sett
Copy link

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 Luca-Sett added the bug Something isn't working label Jan 16, 2025
@ineshbose
Copy link
Collaborator

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

@Luca-Sett
Copy link
Author

Hey @ineshbose, pinging!

@ineshbose
Copy link
Collaborator

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

@Luca-Sett
Copy link
Author

Thanks for taking a look and for providing a workaround!

@pi0
Copy link
Contributor

pi0 commented Feb 4, 2025

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?

@ineshbose
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working has-workaround
Projects
None yet
Development

No branches or pull requests

3 participants