Getting HTML 200 from fetch instead of JSON
did you request json from the backend? not sure if it expects to be told what to return
37 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
oh yeah response.json is going to be a function
ok so the backend should never return anything BUT json
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
these are on different ports yeah?
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
i mean
http://localhost:8080
vs http://localhost:8081
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
ah
so that's one problem
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
you're making the request in your frontend, to your front end server
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
says fetch from the same origin i'm on
/payment_intents/${paymentIntent.id}/capture
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
it doesn't know that your backend is on a different server
it only knows what you told it
so you'd either want to tell it that and deal with CORS
or you'd set up proxying
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View