You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had my code like this, what should work according to the docs, using TypeScript: import createMollieClient, { PaymentStatus } from '@mollie/api-client';
When using this with babel transpiled to CJS this worked fine (NodeJS 16.x)
I recently updated my project to Node 18.18.0, using ESBuild and ES modules as build output.
At development time, TypeScript was fine with this.
But when running the code, it raised this error: TypeError: createMollieClient is not a function.
After some investigation I saw that the createMollieClient is export as default and as names export, so I tried the import like so:
import {createMollieClient, PaymentStatus } from '@mollie/api-client';
And that worked (notice the named import instead the default export). I has something to do with the way the code is exported and build.
I'm not sure how this is possible, but leaving this here to maybe save others some time...
The text was updated successfully, but these errors were encountered:
I had my code like this, what should work according to the docs, using TypeScript:
import createMollieClient, { PaymentStatus } from '@mollie/api-client';
And calling the createMollieClient code like so:
When using this with babel transpiled to CJS this worked fine (NodeJS 16.x)
I recently updated my project to Node 18.18.0, using ESBuild and ES modules as build output.
At development time, TypeScript was fine with this.
But when running the code, it raised this error:
TypeError: createMollieClient is not a function
.After some investigation I saw that the createMollieClient is export as default and as names export, so I tried the import like so:
import {createMollieClient, PaymentStatus } from '@mollie/api-client';
And that worked (notice the named import instead the default export). I has something to do with the way the code is exported and build.
I'm not sure how this is possible, but leaving this here to maybe save others some time...
The text was updated successfully, but these errors were encountered: