#danboyle-cloudflare

1 messages ยท Page 1 of 1 (latest)

haughty grotto
#

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

vivid dawn
#

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.

haughty grotto
#

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?

vivid dawn
#

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

ocean moon
#

Hey there ๐Ÿ‘‹
Stepping in for koopajah here

vivid dawn
#

Hey! Thanks

ocean moon
#

Not sure if its going to help but can you try upgrading the package to the latest version? 8.210.0

vivid dawn
#

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.

ocean moon
#

Ah I see. Not terribly familiar with that syntax.

vivid dawn
#

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

ocean moon
#

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.

vivid dawn
#

Cool. thanks for your help. I will submit a ticket.

ocean moon
#

NP! ๐Ÿ™‚