#danboyle-cloudflare
1 messages ยท Page 1 of 1 (latest)
Hello! I can try to help but I barely understand the words you're using unfortunately as I've never touched any of this
What exact error are you hitting with which exact part of your code?
We added support for Cloudflare workers in stripe-node a few months ago for example
Thanks. I'll try to be clear. I am using this code to create my stripe instance... const stripe = new Stripe(env.STRIPE_TEST_SECRET_KEY, { apiVersion: '2020-08-27', httpClient: Stripe.createFetchHttpClient(), })
But when wrangler tries to build my Worker... it errors out saying it can't part the json config object.
what does "it can't part the json config object" mean?
what error do you get exactly? What does wrangler have to do with the flow?
node_modules/stripe/package.json (2:8)
1: {
2: "name": "stripe",
^
3: "version": "8.207.0",
4: "description": "Stripe API wrapper",
Error: Unexpected token (Note that you need @rollup/plugin-json to import JSON files)
but when I try to use the rollup plugin it still does not work
Hey there ๐
Stepping in for koopajah here
Hey! Thanks
Not sure if its going to help but can you try upgrading the package to the latest version? 8.210.0
yeah I'll give it a go
Sorry didn't work. I think this is because of the esm syntax used in Workers that use Durable Objects? That is the only thing that makes my Worker different from a "normal" Worker.
Ah I see. Not terribly familiar with that syntax.
I'm pretty sure you must've google the error already but it seems like someone was running into the same error on Sapper/Svelte
Have you tried the suggested answer already?
https://stackoverflow.com/questions/59899928/sapper-svelte-rollup-plugin-json-giving-error-with-stripejs
Yes I have tried this but it produces another error. Ugh... It's no major issue has I can run my Stripe endpoints on something different... just wanted to keep it all in Workers if possible
Yeah unfortunately we haven't come across any known issues that'd cause this error to pop up.
I'd suggest writing to our support team at https://support.stripe.com/?contact=true sharing the full code, library versions etc so that we can dig deeper into this.
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Cool. thanks for your help. I will submit a ticket.
NP! ๐