T
TanStack3w ago
stormy-gold

Upgrading to v5.59 causes crashes on sandboxed environment

Upgrading react-query from 5.56.2 to 5.59.0 causes my app to crash. I've tried debugging this for hours but cannot figure out what is concretely causing this. My app runs inside a sandboxed JS environment that uses react 18, namely in the Shopify POS app. I can attach the debugger, but unfortunately even the debugger crashes, making it impossible for me to figure this out. Does anybody have any idea what could be causing this? I certainly don't. I'm not sure if it's just some JS API used by 5.59.0 that is restricted by the sandboxed env, or if its something else. I've been trying to figure this out for hours but haven't had any luck, so wondering if anyone has encountered a similar issue
3 Replies
stormy-gold
stormy-goldOP3w ago
And yes I did look through the changelog, and could not identify anything problematic inside the PRs included in this release
ratty-blush
ratty-blush3w ago
Are you able to retrieve your specific version 18.x of React in your sandboxed JS environment ?
stormy-gold
stormy-goldOP3w ago
Yes I have it pinned to react@18.3.1 Just ran a diff of my build artifacts and the only difference the changes in this PR: https://github.com/TanStack/query/pull/7988/files Afaik the only real difference is the use of / instantiation of currentThenable, which is instantly rejected. Perhaps in my environment that is causing a global error somehow, despite thenables having a noop catch-all Another thing I believe could be it is the deletion of resolve and reject: https://github.com/TanStack/query/pull/7988/files#diff-7ed2d3d0430e5cb3d104692d5983814850817be9ce60edddc994713b39294eecR56-R62 Maybe those are being called twice somehow Just tested on an android, and it worked.... Doesnt work on my iphone. Seems like its indeed some weird promise timing bug or something Consistently broken on iphone Seems like the two theories above are not true. I patched those and still see the same behavior https://github.com/TanStack/query/pull/7988/files#diff-144cf89d34f29ea1e30da14ec1cd6c323b645d0d446435aa1373b7d0fa00ccbcR90-R92 Looks like this is the culprit - commenting it out makes it work. The reject function is likely not set at this point (specifically on JSCore) due to the promise resolver being called at a later tick than other runtimes Creating a PR.. Still haven't been able to properly reproduce it .... I've just used patch-package in my own project as a temporary fix

Did you find this page helpful?