mailjet / mailjet-apiv3-nodejs

[API v3] Official Mailjet API v3 NodeJS wrapper
https://dev.mailjet.com
MIT License
232 stars 67 forks source link

The requested module does not provide an export named 'default' #274

Closed Zerkley closed 2 days ago

Zerkley commented 3 months ago

Hello, I get this error:

Uncaught SyntaxError: The requested module '/node_modules/.vite/deps/node-mailjet.js?v=38aae28a' does not provide an export named 'default' (at useMail.tsx:1:1)

when trying to import the dependency. It is the same error when I import like:

import { Client } from 'node-mailjet';

or

import Mailjet from 'node-mailjet';

I'm using it in a React web, using Typescript.

dandv commented 2 days ago

I get this with node --loader ts-node/esm myscript.ts, no React or anything:

import { Client } from 'node-mailjet';
         ^^^^^^
SyntaxError: Named export 'Client' not found. The requested module 'node-mailjet' is a CommonJS module, which may not support all module.exports as named exports.
dandv commented 2 days ago

@Zerkley ??