vue-email / nuxt

💚 Official Nuxt module for Vue Email. Build email templates with Vue components.
https://vuemail.net/getting-started/nuxt-nitro
MIT License
109 stars 3 forks source link

Cannot find module #32

Closed mtrnik closed 7 months ago

mtrnik commented 7 months ago

Hello, I have problems when running this in Nuxt 3.10 in production.

The app compiles successfully, but I always get this email in runtime when I try to send an email:

Node.js v20.11.0 Mac-mini:web harry$ node ./.output/server/index.mjs Listening on http://[::]:3000 New request: http://localhost:3000/api/emails/team/activated Error loading component node:internal/modules/cjs/loader:598 throw e; ^

Error: Cannot find module '/Users/harry/Documents/mamp/dpnb_2024/web/.output/server/node_modules/vue-email/dist/index.cjs' at createEsmNotFoundErr (node:internal/modules/cjs/loader:1181:15) at finalizeEsmResolution (node:internal/modules/cjs/loader:1169:15) at resolveExports (node:internal/modules/cjs/loader:591:14) at Module._findPath (node:internal/modules/cjs/loader:668:31) at Module._resolveFilename (node:internal/modules/cjs/loader:1130:27) at Module._load (node:internal/modules/cjs/loader:985:27) at Module.require (node:internal/modules/cjs/loader:1235:19) at require (node:internal/modules/helpers:176:18) at /Users/harry/Documents/mamp/dpnb_2024/web/.output/server/node_modules/import-string/dist/CiqvkLgy-kalP_9eSAAli.js:36:24 at Script.runInContext (node:vm:133:12) { code: 'MODULE_NOT_FOUND', path: '/Users/harry/Documents/mamp/dpnb_2024/web/.output/server/node_modules/vue-email/package.json' }

When I look at the mentioned directory there is index.mjs file, but not index.cjs.

What should I do to resolve the issue?

I am using this version of package: "@vue-email/nuxt": "^0.8.17"

Thank you for your help.

Flowko commented 7 months ago

could you please provide a reproduction, or at least some content of what you have inside your email template and how you calling it from the api + is it working fine locally ?

mtrnik commented 7 months ago

it is working fine when I run nuxt:dev command.. but it is not working when I run nuxt:build and then nuxt:preview commands.. I was able to get rid of error when I removed all imports from vue emails components.