Comments (3)
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,
);
from gocardless-nodejs.
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
from gocardless-nodejs.
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.
Apr 18, 12:52:32 PM: d1f10929 ERROR [nuxt] [request error] [unhandled] [500] Cannot find module '/var/task/node_modules/gocardless-nodejs/client' imported from /var/task/chunks/billing-request.post.mjs
Did you mean to import gocardless-nodejs/client.js?
at new NodeError (node:internal/errors:387:5)
at finalizeResolution (node:internal/modules/esm/resolve:330:11)
at moduleResolve (node:internal/modules/esm/resolve:907:10)
at defaultResolve (node:internal/modules/esm/resolve:1115:11)
at nextResolve (node:internal/modules/esm/loader:163:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:841:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
at link (node:internal/modules/esm/module_job:75:36)
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
from gocardless-nodejs.
Related Issues (20)
- Internal error in error handling logic HOT 2
- Response types for list is wrong
- Node.js client billing request confirmPayerDetails API wrong name HOT 2
- Seeing ```connect ECONNREFUSED 127.0.0.1:443``` coming from got libary HOT 1
- PaymentChargeDate
- [bug ?] broken types for gocardless-nodejs/webhooks HOT 3
- Unprocessable Entity HOT 4
- Angular 12 error: gocardless is not a function HOT 2
- [BUG] BillingRequestMandateRequest defined twice HOT 1
- Billing request types doesn't match documentation HOT 4
- Metadata typing allows all JSON objects but only strings are accepted by the API
- Everything is now optional by default in v3.0.0 HOT 1
- Typescript definitions for core client? HOT 1
- InvalidStateError: Customer has not yet completed the Billing Request Flow payment pages
- 'description' attribute in redirectFlows.create() is ignored
- What is the rational for making every field optional HOT 3
- Typescript experience is not great HOT 4
- Can't import * as gocardless from 'gocardless-nodejs'; HOT 2
- Types don't match reality
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gocardless-nodejs.