#pastrami-uri-malformed

1 messages ยท Page 1 of 1 (latest)

empty cosmos
#

Hello @agile oxide. The channel is quite busy but catching up in a bit

empty cosmos
#

okay back

#

Do you have an easy way to reproduce? Can you share some exact code you're using?

upbeat ember
#

hey @empty cosmos ! i'm another dev on this team. we are only able to reproduce this on localhost. in our App.js we are doing this:

const key = 'pk_test_***'
const stripePromise = loadStripe(key)

we are also including the stripe.js script in the head of our index.html.

this same code works fine for our live key, including on localhost. it seems to be something specific about the pk_test prefix. we tried garbage "keys" with this prefix, and with pk_live as the prefix. the ones with pk_test always give the above error, with pk_live they all succeed (at least to the step of rendering the Stripe React elements as we'd expect).

#

we have also tried pushing this same code to our staging environment, just to see if we get the same error. we do not, with either the live or test keys.

empty cosmos
#

Does the page crash even with just that JS code and nothing else?

upbeat ember
#

the page doesn't crash, it just produces this error, and Stripe React elements do not populate.

empty cosmos
#

I understand but I need a way to reproduce or view this

#

(sorry there are 20 people now all asking for help in parallel)

empty cosmos
#

@upbeat ember okay the channel calmed down so I can pair more if you're still around

empty cosmos
#

Unfortunately without more details there's nothing we can do. If you can come back and provide details to reproduce we can help you debug this further.

#

Going to archive this thread for now

frank laurel
#

@agile oxide I have re-opened the thread

agile oxide
#

tyty. we are creating a git repo w/ small sample that is failing for us.

#

we went to lunch at 1130ish so we werent able to get back til now

#

if you load the page, you will see the error in dev tools

#

any key we use that has pk_test_* will fail

#

I used a fake key in the example, however I can provide a real test key if needed (albeit, we'll remove it from our account)

empty cosmos
#

that example loads fine for m with no error in the dev tools

#

do you see the error in the console just on load?

#

I can also interact with the Stripe instant and make API requests there

#

that exact code fails locally for you just on page load?

#

cc @agile oxide

agile oxide
#

yes exact code fails.. that is interesting

#

im on mac 12.4

#

using latest chrome

#

Version 102.0.5005.61 (Official Build) (x86_64)

#

(or close to latest)

#

is there somewhere I can get unminified stripe.js ? to help troubleshoot

empty cosmos
#

and if you remove the 2 Stripe lines then it stops failing?

agile oxide
#

yes. caused by the Stripe contructor

#

we do not receive error if we remove Stripe() or if we use a key like pk_aksjldkfajldfakjd instead of pk_test

#

that is the only observation we have made

#

@empty cosmos going to DM u with a test key we have

empty cosmos
#

Publishable keys aren't really secret. But I tried it in the code, still no error

#
  • using stripe-js wrapper at 1.32.0
    you mentioned this earlier, what does that mean?
agile oxide
#

we use react w/ stripe-js in our main app which is where we noticed the error. I then removed all libs and gave you the smallest repro case

#

we're not able to use test key on localhost to develop

#

is there anything I can try and/or where is decodeURIComponent being used?

#

it sounds like there is something machine dependent that is happening

empty cosmos
#

can you try ngrok?

#

so I can load that page and see if it's machine dependent where the code runs (your app) or on the client (when it loads in my browser)

agile oxide
#

TIL ngrok

#

never used but yeah I can try

#

does not show error on ngrok

#

still on localhost

empty cosmos
#

the plot thickens

#

Does it happen in another browser?

#

Can you try chrome in private browsing mode which will disable browser extensions too?

agile oxide
#

lol plot thickens yes

#

incognito -> no error
safari -> no error

empty cosmos
#

that smells like a bad chrome extension then

#

try disabling them all and you should see the error go away and then re-enable them until you find the culprit

agile oxide
#

disabled extensions and no bueno... so maybe cache somewhere

#

fwiw, only extensions on browser rn are 1password and lastpass

upbeat ember
#

i just tried it on firefox. no error there either. ๐Ÿ˜ฉ which i would say for our purposes unblocks us

agile oxide
#

eesh. @empty cosmos it was something in cache/data

#

Clear Browsing Data -> clearing cookies + site data and we are all set

#

@upbeat ember can u try to only clear Cached Images and Files

empty cosmos
#

damn so there must be something off in a cookie that could be causing this. We're also looking internally what could cause this

upbeat ember
#

that didn't work for me, but it did work on firefox. i have not used firefox on this machine before though, so the theory that it is cookie related does still hold water

agile oxide
#

@empty cosmos any cookie/reference you want us to grab and send?

empty cosmos
#

Have you both used Link before (to save card details during a payment)?

upbeat ember
#

i have, yes

empty cosmos
#

stripe.link.persistent_token, __stripe_mid, __stripe_sid
^ those cookies would be helpful. They are likely sensitive so DM me

upbeat ember
#

hmmm i'm not seeing those in my cookies. maybe i'm incorrect that i have used that....

empty cosmos
#

the last 2 should happen whenever you load Stripe

agile oxide
#

@empty cosmos I will help @upbeat ember to grab cookies and we'll ping u. ETA might be an hour but will tag u when sent

empty cosmos
#

sounds

agile oxide
#

@empty cosmos i checked stripe.com and localhost cookies. Only one I had was __stripe_mid

#

i've dmed you

empty cosmos
#

I didn't get a DM

#

ah got it

#

I can't do anything with a picture ๐Ÿ˜…

empty cosmos
#

@agile oxide since we narrowed down the issue I'm going to archive. Our engineering team is looking into improving the code to better handle this error. That code is 5+ years old and you're the first person to ever report this so seems like really bad luck