#FACELESSMAN

1 messages · Page 1 of 1 (latest)

forest rapidsBOT
fathom cobalt
#

Hi, are you seeing any errors? What changes did you recently make?

twilit scarab
#

No errors on my side until this:

#
TypeError: Failed to fetch
    at http.tsx:45:12
    at Generator.next (<anonymous>)
    at fulfilled (ext.js:55:26)
#

my CSP is defined here:

    "content_security_policy": {
      "connect-src": [
        "https://sfdc-stripe.fly.dev/api/customer",
        "https://sfdc-stripe.fly.dev/api/chatter",
        "https://sfdc-stripe.fly.dev/api/logout"
      ],
#

so ideally it should be able to fetch?

#

that TypeError: comes from me doing this

} catch (e: any) {
        console.log(e);

In a network call

#

where I try to do a POST request:

...

 const res = await HTTPClient.callBackend("/api/customer", "POST",
...
#

I wonder if there is some kind of "permission" blocking me - it never happened before to me

fathom cobalt
#

Taking a look

#

What's triggering the fetch? Is it some kind of event? If so are they preventing the default behavior of that event so the fetch has a chance to finish?

twilit scarab
#

No, nothing is preventing the default behaviour. The fetch happens when you open up the "Customer" view

fathom cobalt
#

You should prevent the navigation with event.prevetDefault()

twilit scarab
#

I am expecting to this
setStatus(Status.NotSetup);

#

instead I get a network Error

#

but if I try to hit that API route manually

#

it should return something like {"type":"stripe","message":"Unable to extract timestamp and signatures from header"}

#

or anything.....but why would it instead "prevent fetch" from the browser side (the Stripe App)

#

almost like the Stripe App is blocking itself?

dusky fractal
#

Hello! I'm taking over and catching up...

#

So usually TypeError: Failed to fetch is a result of the browser navigating before fetch can finish and return data, usually because fetch is being triggered by some kind of event that's causing navigation and you're not preventing that behavior. What is triggering fetch?

#

Is it like an event listener on a button press? A form submit? Something else?

twilit scarab
#

so a navigation into the Customer page of the dashboard would trigger that fetch

dusky fractal
#

What browser are you using?

twilit scarab
#

Chrome and Firefox

#

on Ubuntu

#

I can try to explore more the code but its weird that suddenly it stopped working when this used to work a couple of weeks back - I was curious if anything changed that would prevent this in Stripe Apps

#

hence me asking

#

I can come back Monday and give it a different try over the weekend

#

all code is open source on that repo btw

dusky fractal
#

You haven't modified the code at all?

twilit scarab
#

well it uses my own .env of course ;P

#

Anyway I wasn't trying to write a whole chapter of a book, I was just curious if you knew of any changes to Stripe Apps - I tried to DM the other channel for Stripe apps but it's being retired

dusky fractal
#

I do not know of any changes, no.

#

One thing you might want to try is recording a network capture in Chrome when the error happens to see what's happening at a low level: chrome://net-export/

twilit scarab
#

Thanks I will check

#

Will circle back next week