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

source.on is not a function with cid attachments #107

Open
mschoeffmann opened this issue May 14, 2021 · 4 comments
Open

source.on is not a function with cid attachments #107

mschoeffmann opened this issue May 14, 2021 · 4 comments

Comments

@mschoeffmann
Copy link

after upgrading from 2.0.3 to 2.1.3, sending an email throws the following exception:

error: TypeError: source.on is not a function
    at Function.DelayedStream.create (/Users/x/Source/x/app-backend/node_modules/delayed-stream/lib/delayed_stream.js:33:10)
    at FormData.CombinedStream.append (/Users/x/Source/x/app-backend/node_modules/combined-stream/lib/combined_stream.js:45:37)
    at FormData.append (/Users/x/Source/x/app-backend/node_modules/form-data/lib/form_data.js:75:3)
    at /Users/x/Source/x/app-backend/node_modules/mailgun.js/dist/mailgun.js:2:13253
    at Array.forEach (<anonymous>)
    at /Users/x/Source/x/app-backend/node_modules/mailgun.js/dist/mailgun.js:2:13230
    at Array.forEach (<anonymous>)
    at e.postMulti (/Users/x/Source/x/app-backend/node_modules/mailgun.js/dist/mailgun.js:2:13164)
    at e.create (/Users/x/Source/x/app-backend/node_modules/mailgun.js/dist/mailgun.js:2:8661)
    at mailgunSend (/Users/x/Source/x/app-backend/node_modules/nodemailer-mailgun-transport/src/index.js:149:40)
    at Object.send (/Users/x/Source/x/app-backend/node_modules/nodemailer-mailgun-transport/src/index.js:127:26)

this is the base for newly created emails:

const email = new Email({
  transport,
  message: {
    from: config.email.from,
    attachments: [
      {
        filename: 'logo.png',
        path: `${path.resolve('emails')}/logo.png`,
        cid: '[email protected]',
      },
    ],
  },
  juiceResources: {
    preserveImportant: true,
    webResources: {
      relativeTo: path.resolve('emails'),
    },
  },
  send: true, // send also in development mode
  preview: config.env === 'development' && {
    open: {
      app: 'google chrome',
      wait: false,
    },
  },
});

and the problem goes away after removing the line cid: '[email protected]'

after some reseach, i guess this is related to mailgun/mailgun.js#141 but since the update from 2.0.3 to 2.1.3 broke it, i wanted to keep you informed ...

@TheArKaID
Copy link

TheArKaID commented May 19, 2021

I don't even know if mailgun.js really fixed the inline image support. They doc is still bad, and the mailgun/mailgun-js#141 just adds a few things, without any additional doc or test.

@orliesaurus
Copy link
Owner

Thank you @mschoeffmann

@freysie
Copy link

freysie commented May 28, 2021

i'm seeing this error too

big thanks to @mschoeffmann for letting us know which version to downgrade to in the meantime!

@bartoszhernas
Copy link

Thank you for this issue, saved me some time digging into what is happening :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants