App reviews, troubleshooting, and recommendations
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
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();}, []);
Thanks for help