I am building a Shopify POS UI extension and I am updating the cart, and also reacting to cart updates. I am using the useCartSubscription hook, which by following the documentation should handle the 1 subscription per cart limitation of the api.cart hook.
import { useApi, useCartSubscription } from "@shopify/ui-extensions-react/point-of-sale";
export default function MyModal() {
const api = useApi<"pos.home.modal.render">();
const cart = useCartSubscription();
// Do stuff
return (/*stuff*/);
}
If I remove the cart subscription part, the error does not appear. But once I make a cart subscription, the extension gets that error banner.
Also, if I change the cart in my extension, then check the cart in the Shopify POS App, the same error banner appears.
What can I do about it?