Closed fvkramer closed 1 year ago
Hi @fvkramer can you please provide a smaller repro? It's very hard to debug issues like this without an actual project, webpack config, etc. I'd recommend checking webpack config to see if any unintended transformations are happening.
We also have a nextjs sample at https://github.com/stripe/stripe-node/tree/master/examples/webhook-signing/nextjs
Hey @pakrym-stripe, I found the issue comparing my repo to a fresh install.
I had these lines in the next.config.js
config.module.rules.push({
test: /\.node/,
use: 'raw-loader',
});
Somehow this conflicts with the stripe
package. That config rule I added because I'm using a pdf rendering library, and needed this in my webpack. I'm not sure why it conflicts, but removing those lines solves the above issue.
There is a file called stripe.node.js
in the package. Looks like that rule matches is and breaks Stripe's module loading. There was another customer reporting a similar issue, consider reusing their solution: https://github.com/stripe/stripe-node/issues/1896#issuecomment-1711802291
Describe the bug
I'm adding stripe integration into a NextJS 13.4+ app. I have an endpoint that looks like this:
but running into the following error when the endpoint is triggered:
This may be a NextJS/config issue, but need a second pair of eyes. Also, I saw this issue posted previously https://github.com/stripe/stripe-node/issues/1000, but it was closed due to inactivity. So, resurfacing.
To Reproduce
Node Version: 18.12.0
Package.json:
tsconfig.json
Expected behavior
Stripe instance should be instantiated without problems.
Code snippets
No response
OS
macOS
Node version
Node V18.12.0
Library version
14.1.0
API version
Latest
Additional context
No response