0

I'm running into an issue deploying my Qwik app to Vercel. Whenever nodemailer is imported, it causes the build to fail with this error:

[commonjs--resolver] Cannot bundle Node.js built-in "events" imported from "node_modules/nodemailer/lib/mailer/index.js". Consider disabling ssr.noExternal or remove the built-in dependency.```


I've tried:

Upgrading nodemailer to the latest version
Adding ssr.noExternal to my vite config
Removing nodemailer entirely and the build succeeds

But I need to keep nodemailer for sending emails. How can I resolve this conflict between nodemailer and Vercel/Qwik?

My packages:

Qwik 1.2.6
Nodemailer 6.9.4
Vercel CLI 29.1.1
Node v18.17.1.
  • Isn't qwik a frontend framework while nodemailer is a backend emailing library for node js? How does something in your backend server crash your frontend app? – Syed M. Sannan Sep 02 '23 at 07:57

0 Answers0