Open Fedevs opened 2 months ago
I'm getting the same issue in my SolidJS + Tauri project
Vite version: 5.0.0 SolidJS version: 1.7.8 Mailgun.js version: 10.2.3 Browser: Chrome 127.0.6533.73 Operating System: Windows 10
But using a dynamic import is a workaround for now:
let Mailgun: any;
import('mailgun.js').then(module => {
Mailgun = module.default;
initializeMailgun();
});
let mg: any;
function initializeMailgun() {
const mailgun = new Mailgun(formData);
mg = mailgun.client({
username: "api",
key: import.meta.env.VITE_MAILGUN_API_KEY,
});
}
Same issue using with typescript in a Turborepo package
Having the same issue with remix and turborepo
Same. Anybody gonna fix this at Mailgun? What a pain.
nah that's broken.
Same issue with my QwikCity project
I am having this same issue building a Bun project that uses mailgun.js.
Description
I'm encountering a
SyntaxError
when trying to importmailgun.js
in a project created using Vite and React. The error message is as follows:Uncaught SyntaxError: The requested module '/node_modules/.vite/deps/mailgun__js.js?v=68b1499c' does not provide an export named 'default'
This occurs when trying to import
mailgun.js
using the default import syntax:Environment
Vite version: 5.2.0 React version: 18.2.0 Mailgun.js version: 10.2.1 Browser: Chrome 126.0.6478.127 Operating System: Windows 11
Expected Behavior
mailgun.js should be successfully imported without any syntax errors.
Actual Behavior
A SyntaxError is thrown indicating that the default export is not provided by mailgun.js.