nuxt / nuxt

The Intuitive Vue Framework.

Home Page:https://nuxt.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doesn't find indirect dependency of module when using pnpm

dword-design opened this issue · comments

Environment

  • Operating System: Darwin
  • Node Version: v18.19.0
  • Nuxt Version: -
  • CLI Version: 3.11.1
  • Nitro Version: -
  • Package Manager: pnpm@9.1.0
  • Builder: -
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://github.com/dword-design/demo-nuxt-pnpm-module-dependency

This demo is using my module nuxt-mail, which in turn depends on @dword-design/functions. nuxt-mail generates files using addTemplate, which import @dword-design/functions. But since the templates aren't inside node_modules anymore, they can't find the indirect dependency inside the pnpm cache.

Maybe it's not a bug and I have to generate the templates differently.

Describe the bug

If I use pnpm to install dependencies and use a Nuxt module that generates files using addTemplate, which depend on a dependency again, this dependency cannot be resolved because the template is generated outside node_modules.

Related:
dword-design/nuxt-mail#227

Logs

Bildschirmfoto 2024-05-06 um 14 08 11