[BUG] Cannot dispatch event (resolve) for current cart state (uninitialized)
Reported on Discord by MagnusChase:
Clients are getting it quite a lot, I already fixed it one time (changed
<Link>tags to<a href>because it was slow and broke the page load), but it starts to pop-up again. This error is visible after you return to a page that you have had opened (and not been on it) for quite a while
Also, does anyone have an idea what is that error? I tried to find the cause of it, but it looks like it occurs at page load (mostly product page)
As far as I've heard from the client, it only appears when you leave it open for a while and start using it again, hovewer bizzare it sounds
The errors could be related, and the "Something's wrong here" could be showing up just because another error is unrecoverable.
It seems clear that at least there's a bug in Cart.client.tsx where the state of the cart goes back to uninitialized under certain conditions.
We really should rebuild the cart cc @frehner
Ugh, yeah, another situation where the cart gets into an impossible state ☹️
Hey, clients on Safari (iOS and macOS) have been getting into another of those cart states (after clicking add to cart), I think it could be connected to this

@lordofthecactus — I'm going to move up the cart rebuild in priority in our cycle goals, though still, this should follow #1773
IMO the cart should be built with a minimal state machine. Doing so would make invalid states impossible. Something super small like: https://thisrobot.life/

