0

I am developing a Hydrogen (1.6.1) site. I have the @sendgrid/mail (7.7.0) package and I am able to successfully send messages on my local dev environment. However, when I deploy to Vercel, I'm getting the message...

[FAILED] Cannot bundle Node.js built-in "fs" imported from "node_modules/@sendgrid/helpers/classes/attachment.js". Consider disabling ssr.noExternal or remove the built-in dependency.
╭─ error ──────────────────────────────────────────────────────────────────────╮
│                                                                              │
│  Cannot bundle Node.js built-in "fs" imported from                           │
│  "node_modules/@sendgrid/helpers/classes/attachment.js". Consider disabling  │
│   ssr.noExternal or remove the built-in dependency.                          │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯

I have tried disabling ssr.noExternal as suggested, but the app won't build in this configuration. Has anyone been able to deploy under this infrastructure?

Sel
  • 342
  • 1
  • 12
  • Same problem with Netlify, did you fix this? – Wgg12 Nov 01 '22 at 15:23
  • @Wgg12 I ended up using https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-ses on Netlify. Couldn't get Mailgun, Sendgrid or SES to work on Vercel and both Vercel and Netlify customer support is non-existent... – Sel Nov 02 '22 at 04:11

1 Answers1

1

We solved it by moving it into a netlify function.

moladukes
  • 46
  • 4