Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deepmerge needs to be updated to latest version to prevent webpack bug #899

Closed
celicoo opened this issue Feb 28, 2019 · 9 comments · Fixed by #935 or #1039
Closed

deepmerge needs to be updated to latest version to prevent webpack bug #899

celicoo opened this issue Feb 28, 2019 · 9 comments · Fixed by #935 or #1039
Labels
difficulty: easy fix is easy in difficulty status: help wanted requesting help from the community type: bug bug in the library

Comments

@celicoo
Copy link

celicoo commented Feb 28, 2019

Issue Summary

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.

Steps to Reproduce

  1. Setup Webpack
  2. Send a transactional email injecting dynamic template data, e.g:
import sgMail from '@sendgrid/mail'

sgMail.setApiKey(process.env.SENDGRID_API_KEY)

sgMail
  .send({
    to: 'me@sendgrid.com',
    from: 'no-reply@sendgrid.com',
    templateId: '...',
    dynamicTemplateData: {
      name: '',
    },
  }).catch(console.error)

Technical details:

  • sendgrid-nodejs version: 6.3.1
  • Node.js version: 10.15.1
@thinkingserious thinkingserious added type: bug bug in the library status: help wanted requesting help from the community difficulty: easy fix is easy in difficulty up-for-grabs labels Feb 28, 2019
@thinkingserious
Copy link
Contributor

Thanks for bringing this to our attention @celicoo! I've added this to the backlog.

@celicoo
Copy link
Author

celicoo commented Apr 15, 2019

@thinkingserious any update on this?

@richardcase
Copy link

Is this going to be included in a release soon?

@adamf
Copy link

adamf commented Oct 15, 2019

Hi, this is blocking sendgrid adoption for us. Any ETA on release?

@robertsmikej
Copy link

Blocking adoption for us too, please let us know what the status is. Thanks!

@phu-bc
Copy link

phu-bc commented Oct 24, 2019

I am getting this issue too :(

@terryds
Copy link

terryds commented Oct 30, 2019

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',
      }
  }

@pzhine
Copy link

pzhine commented Feb 5, 2020

Note that updating to 6.5.1, which includes #935, didn't work. I had to implement the workaround by @terryds, which worked!

@danb235
Copy link

danb235 commented Feb 6, 2020

Also ran into this issue... giving @terryds's dirty solution a try... come on sendgrid!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: easy fix is easy in difficulty status: help wanted requesting help from the community type: bug bug in the library
Projects
None yet
10 participants