dword-design / nuxt-mail

Adds email sending capability to a Nuxt.js app. Adds a server route, an injected variable, and uses nodemailer to send emails.
Other
247 stars 18 forks source link

Cannot find package '@dword-design/functions' #227

Open tmmsmoreira opened 7 months ago

tmmsmoreira commented 7 months ago

Hey guys!

After I installed nuxt-mail on my project, I am not being able to run the project again because I get this error:

[12:27:01 AM]  ERROR  [worker reload] [worker init] Cannot find package '@dword-design/functions' imported from /Users/tiagomoreira/Projects/my_project/.nuxt/nuxt-mail/send.mjs
Did you mean to import @dword-design+functions@6.0.0/node_modules/@dword-design/functions/dist/index.js?

  Did you mean to import @dword-design+functions@6.0.0/node_modules/@dword-design/functions/dist/index.js?
  at __node_internal_captureLargerStackTrace (node:internal/errors:490:5)
  at new NodeError (node:internal/errors:399:5)
  at packageResolve (node:internal/modules/esm/resolve:889:9)
  at moduleResolve (node:internal/modules/esm/resolve:938:20)
  at defaultResolve (node:internal/modules/esm/resolve:1153:11)
  at nextResolve (node:internal/modules/esm/loader:163:28)
  at ESMLoader.resolve (node:internal/modules/esm/loader:838:30)
  at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
  at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:77:40)
  at link (node:internal/modules/esm/module_job:76:36)

I already removed my node_modules folder and package-lock.json file and made a clean installation, but the problem persists.

dword-design commented 7 months ago

@tmmsmoreira Can't reproduce. This is the demo project I used to try it out. I'd need a minimal reproduction example.

dmecke commented 7 months ago

I encountered the exact same issue. So I tried your demo project - and had the issue there as well. After a bit of research I found that it does work (both in the demo project as well as in my project) when installing the dependencies via npm or yarn, but not with pnpm. This is what I originally used.

I wasn't able to track down why exactly it fails when using pnpm though. I have never had such an issue with it before, I guess it might be related with some setting in the package.json of this package or @dword-design/functions.

dword-design commented 7 months ago

@dmecke Thanks for digging into this, I can reproduce it with pnpm. I don't know much about pnpm, but when installing it via pnpm install, most of the dependencies aren't in node_modules, so I'm asking myself how the module resolution would work. I guess it has to do with that I'm generating a nuxt-mail folder and he can't resolve the stuff from there.

vinumweb commented 6 months ago

@dword-design Any updates? I am trying to use nuxt-mail but it just wont work at all with PNPM.

dword-design commented 6 months ago

@vinumweb I've added an issue in the Nuxt repo.

Kuuzoo commented 6 months ago

Hi there, I do have the same problem, when using PNPM... So for now, there is no way to be installing it with pnpm?

AloisSeckar commented 5 months ago

This is an unfortunate problem :( I was just about to start using nuxt-mailer, as I was looking for an email sending solution for my Nuxt app today, but this prevented me from doing so. Hope it will get fixed soon! Wish I can help, but I lack skills and knowledge for that.

On the other hand, I found out all I need for my use case is to use bare NodeMailer in my Nuxt server route handler...