## The problem
Issue mailgun/mailgun-js#384 (closed, 9 comments): `const Mailgun = require("mailgun.js"); new Mailgun(formData)` throws `TypeError: Mailgun is not a constructor`. The only workaround was mixing namespace imports, which then broke key validation with `Error: Parameter "key" is required`.
## What to do
`new Mailgun(formData)` throwing `TypeError: Mailgun is not a constructor` is a packaging bug in mailgun.js, fixed in v12.0.0. Upgrade to mailgun.js 12.0.0 or later and the plain require("mailgun.js") constructor works again. Do not work around it with namespace-import tricks; those break key validation with `Error: Parameter "key" is required`.