sofn-xyz / mailing

Build, test, send emails with React
https://www.mailing.run
MIT License
3.6k stars 74 forks source link

Empty email body when sending from NextJS 13 server action #475

Open asutula opened 1 year ago

asutula commented 1 year ago

Describe the bug I migrated my NextJS app to use NextJS 13 app router and server actions. A client component calls a server action that results in the sending of an email. In development mode, the intercepted preview shows a blank white screen. A production build deployed to Vercel results in the email being delivered with no content.

I verified my email component does work fine by forcing the send to happen from an API route in the old pages directory, all other things equal. This works as expected.

To Reproduce Steps to reproduce the behavior:

  1. Create a NextJS server action that sends an email
  2. Call the server action from a component
  3. See the intercepted preview is just a white screen

Expected behavior I'd expect to see an accurate email preview and the same email body delivered to the recipient.

Screenshots If applicable, add screenshots to help explain your problem. Screenshot 2023-07-18 at 9 36 21 PM

Desktop (please complete the following information):

asutula commented 1 year ago

App router code is being bundled with webpack, this includes server action code. I'm not sure if this is new with the app router, but maybe the problem has something to do with webpack.