0
You forgot to return the response
in your last .then
callback. So your const response
is actually void
.
const response = await fetch(
"http://localhost:5000/create-checkout-session",
// [...]
)
.then((response) => response.json())
.then((response) => {
console.log("stringied response", JSON.stringify(response))
//
Return `response` here, or the Promise will return the returned value of `console.log` which is `void`!
return response
});
Source:stackexchange.com