We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

After update shopify and remix pacakages getting cros error

After update shopify and remix pacakages getting cros error

Sumit3916
Shopify Partner
10 0 1

HI

When I upgraded Shopify and Remix package, I am getting cors error in Checkout UI extension. This is the code of Checkout UI.

useEffect(()=>{
async function getData() {
try {
const token = await sessionToken.get();
const response = await fetch(`${app_url}/api/checkout/checkout`, {
method: "POST",
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${token}`,
"Access-Control-Allow-Origin": "*",
},
body: JSON.stringify({
shop: shop.myshopifyDomain,
checkout_token : `${checkoutToken}`
}),
});
 
const data = await response.json();
console.log("Fetched data:", data); // Handle the data as needed
} catch (error) {
console.error("Error fetching data:", error);
}
}
getData();
}, []);
Sumit3916_0-1738573910541.png


Thanks for help

Replies 0 (0)