Skip to content
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

Can't import * as gocardless from 'gocardless-nodejs'; #154

Closed
matteusbarbosa opened this issue Feb 17, 2023 · 2 comments
Closed

Can't import * as gocardless from 'gocardless-nodejs'; #154

matteusbarbosa opened this issue Feb 17, 2023 · 2 comments

Comments

@matteusbarbosa
Copy link

Hi guys, anyone have any idea why i cant import gocardless?

m using new ES6 syntax from NestJS:

import * as gocardless from 'gocardless-nodejs';

But it results in:

image

@jjholmes927 any ideas?

@matteusbarbosa
Copy link
Author

Found solution for NestJS / ES6 thanks to @mauricedoepke

import { GoCardlessClient } from 'gocardless-nodejs/client';

and instead of calling gocardless(...), instance the client:

    return new GoCardlessClient(
      process.env.GC_ACCESS_TOKEN,
      constants.Environments.Sandbox,
    );

@jjholmes927
Copy link
Contributor

Awesome, Glad you got it resolved! I'll close this @matteusbarbosa 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants