mailgun.js: error creating message v3 TypeError: Only absolute URLs are supported
Hello, I’m working on migrating from version 2.0.6 to 3.3.0. I do have a currently working integration using 2.0.6 and on attempts to update to v3 it has consistently thrown type errors.
I’ve followed the new configuration steps of passing in form-data.
I can get the example to work appropriately in by running it in its own file. I as soon as I move it into the helper function for use in a graphql resolver it starts throwing the type error. Even though it is the same code from the running file.
Below is the stack trace that I keep getting:
TypeError: Only absolute URLs are supported
at getNodeRequestOptions (/.../node_modules/node-fetch/lib/index.js:1305:9)
at /.../node_modules/node-fetch/lib/index.js:1410:19
at new Promise (<anonymous>)
at fetch (/.../node_modules/node-fetch/lib/index.js:1407:9)
at /.../node_modules/isomorphic-unfetch/index.js:4:34
at /.../node_modules/mailgun.js/dist/mailgun.js:2:33929
at new Promise (<anonymous>)
at w._fetch (/.../node_modules/mailgun.js/dist/mailgun.js:2:33843)
at o (/.../node_modules/mailgun.js/dist/mailgun.js:2:31546)
Has any one else hit this and resolved it?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 9
- Comments: 17
The solution I found was to sign up for a competitor : )
@olexandr-mazepa im using nuxt (a vue framework) in Server Side Rendering. I created an api to send email in nuxt.
then i call the api
In development mode it works perfect but when i build and start, it throws me the following error:
@olexandr-mazepa I do not use the lib directly, but it is a dependency of https://github.com/orliesaurus/nodemailer-mailgun-transport which I do use. nodemailer-mailgun-transport is locked to version 3.3.0 of mailgun.js, and it’s author have not updated dependencies since March. At the moment it is obvious that, no matter if this bug (?) in mailgun.js was fixed or not, the author of nodemailer-mailgun-transport should have done something (maybe switched back to what was used before mailgun.js).
for anyone that is running into this, I integrated with the api directly rather than the package for this. here’s something similar to what I ended up using.