The current deepmerge version doesn't work with Webpack:
TypeError: merge is not a function
at Personalization.deepMergeDynamicTemplateData (/opt/sulvo/cloudflare-app/handlers/.webpack/service/webpack:/node_modules/@sendgrid/helpers/classes/personalization.js:289:1)
...
This is a known issue.
import sgMail from '@sendgrid/mail'
sgMail.setApiKey(process.env.SENDGRID_API_KEY)
sgMail
.send({
to: '[email protected]',
from: '[email protected]',
templateId: '...',
dynamicTemplateData: {
name: '',
},
}).catch(console.error)
Thanks for bringing this to our attention @celicoo! I've added this to the backlog.
@thinkingserious any update on this?
Is this going to be included in a release soon?
Hi, this is blocking sendgrid adoption for us. Any ETA on release?
Blocking adoption for us too, please let us know what the status is. Thanks!
I am getting this issue too :(
If currently you're using Webpack, just add this to your webpack config file (I know this is dirty, but it works!).
resolve: {
alias: {
deepmerge$: 'deepmerge/dist/umd.js',
}
}
Note that updating to 6.5.1, which includes #935, didn't work. I had to implement the workaround by @terryds, which worked!
Also ran into this issue... giving @terryds's dirty solution a try... come on sendgrid!
Most helpful comment
If currently you're using Webpack, just add this to your webpack config file (I know this is dirty, but it works!).