## TL;DR

[sina-salahshour (reporter)]: Change the import to a namespace import: import * as formData from 'form-data' instead of the default import. Confirmed fixed by the reporter.

## Steps

1. [sina-salahshour (reporter)]: Change the import to a namespace import: import * as formData from 'form-data' instead of the default import. Default-importing form-data breaks the FormData constructor mailgun.js expects, which throws at runtime under NestJS. Confirmed fixed by the reporter.

## When to use

You are seeing this: mailgun/mailgun-js#339: Issue mailgun/mailgun-js#339 (closed, 7 comments): Using mailgun.js with NestJS, no type errors, but at runtime new Mailgun(formData) throws a form-data error. Use this skill when you run into "form-data runtime error under NestJS: use namespace import".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

## Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
