#asommer12-generic-error
1 messages · Page 1 of 1 (latest)
I do
I am trying to configure Stripe Connect with OAuth
const stripeResponse = await stripe.oauth.token({
grant_type: scope,
code: code
}, {
idempotencyKey: `${idempotencyKey}-oauth`
});
ReferenceError: GenericError is not defined
at Function.generate (/Users/adamsommer/Documents/repo/kable-dashboard/server/node_modules/stripe/lib/Error.js:52:9)
at res.toJSON.then.StripeAPIError.message (/Users/adamsommer/Documents/repo/kable-dashboard/server/node_modules/stripe/lib/StripeResource.js:220:35)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
oooh fascinating
I think this is a bug in stripe-node - the fallthrough case when handling an unknown error type references GenericError, but that class was removed in a commit almost 3 years ago
I can file a bug report about this, but the question remains - why are you getting an error which has unknown type?
i have no idea
I'm following the exact steps in the Stripe Connect OAuth docs
part 4 is the return to my site when I call stripe to connect the account
that's where this is failing
I'm using valid code/grant-types
could you paste the application ID (ca_***) that you're using, and I can take a look at the logs
sorry, what's the application ID? where do i find that?
is that the client_id?
yea
ca_LCG5SdQZBBv5pF9eu75vxpVuzo1QdxMD
yep, still looking
there isn't much useful in the logs
I think you're going to need to be able to look at the error response to figure out what to do next here
you don't think the Node SDK will get fixed in the next day or two?
hard to say
this bug is presumably pretty obscure, since it's been for 3 years
it's unlikely to be an urgent priority, so I don't want to promise a specific timeline
I think the most straightforward way to get the error text is to hotpatch the buggy line to console.log the error response
this is brutal -- I implemented Stripe Connect Direct over the last two days and several hours on Discord with your colleagues -- today I got an update from Stripe that they gave me bad advice and to use OAuth so I've started over
now this...
(maybe that's helpful context to see what's going on?)
unfortunately, I don't think there's much more directed debugging help I can give you with the logs I have available on my side
we can try possible errors at random, but that's going to be painful
do you have a sense if this is an issue with the SDK or with my account?
like should I just code around this?'
or am I totally screwed here
I don't think I could hazard a guess here
the best advice I can give is to patch the buggy GenericError line to log the response
if you edit the Error.js file locally (or on your dev server, etc.) to add a console.log("the mystery error is: " + rawStripeError.type); athttps://github.com/stripe/stripe-node/blob/9bec53e9/lib/Error.js#L52, that should give us something to go on
sorry, never edited a Node library directly before, let me try to find how to do this
if you have a text editor, you can just open the file in node_modules and futz with it directly
okay found it
add a log line where Generic Error is thrown?
here's the real error:
what is the grant type supposed to be?
OHHHHHH
this might unlock me
hang tight
YESSSSS
we're good
hang around here for a few mins if you don't mind
i'm gonna see if i cna get this working
sorry, I snipped that message b/c it contained your dashboard cookies
but I'm glad you've figured it out!