-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ES modules syntax support? #124
Comments
Just stumbled across this issue as we are having the same issue - feels strange that a package like this would not support ES Modules syntax 🤔 |
Hey Both, I'm sure you've solved your issues but this is how you'd go about using the library and get the types support. import { GoCardlessClient } from 'gocardless-nodejs/client';
import Constants from 'gocardless-nodejs/constants';
// Initialise the client.
const gocardless = new GoCardlessClient(
SECRET,
Constants.Environments.Live OR Constants.Environments.Sandbox,
); |
Hi, Thanks for adding your reply - I've been able to get my integration working with Nuxt 3 locally as a result. In a dev env, it all works great and a payment journey is completed successfully but when I deploy to Netlify, I get an error at the billing-request action stage which I think maybe it's as a result of importing the package as an ESM module.
Would you perhaps be able to comment on this and make a suggestion as to what I could try to do to fix it? I contacted their support but I've not had a response. TIA |
Did you managed to solve this ? maybe we can close this issue then, thanks @sohilpandya |
Hello 👋 We use TypeScript throughout our projects. Typically we use ES modules syntax (
import
/export
) to load our modules, this then gets boiled down to CommonJS style (require
) after the compiler has run.It seems this module does not support use of the
import
/export
syntax, is it suppose to?For example we encounter these sorts of errors:
Working example:
Broken example:
The text was updated successfully, but these errors were encountered: