Closed kaikidd closed 3 weeks ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit db71676a953c2511c4be2b4e63dae288ca9d8dd1:
Sandbox | Source |
---|---|
@tanstack/query-example-angular-basic | Configuration |
@tanstack/query-example-react-basic-typescript | Configuration |
@tanstack/query-example-solid-basic-typescript | Configuration |
@tanstack/query-example-svelte-basic | Configuration |
@tanstack/query-example-vue-basic | Configuration |
what kind of environment are you working in please? globalThis
should be available in all envs that we support:
I use @tanstack/react-query in @tarojs/cli(https://github.com/NervJS/taro), it is a runtime framwork tailored for developing specialized mini-applications designed to run on Android and IOS application in China. The customized runtime environment encompasses most browser environments, but there are exceptions, such as the absence of 'globalThis'. I use @tanstack/react-query correctly before a pull request fix(query-core): Replace the deprecated 'window' with 'globalThis' fo...(https://github.com/TanStack/query/pull/7029). @tanstack/react-query version 5.26.3 works fine for me.
The customized runtime environment encompasses most browser environments, but there are exceptions, such as the absence of 'globalThis'.
globalThis
is a standard that was introduced to avoid checks for window
, global
or self
in different environments. It's supposed to be available in all modern environments.
If it's not available for you, please add a polyfill that will set globalThis
to, idk, window
or an empty object or whatever you want. As a last resort, you can also patch-package
react-query.
I'm utilizing @tanstack/react-query within a React project operating in a unique environment. However, during runtime, the global object 'globalThis' is not available, causing errors to be displayed in the console and bringing the entire application down. I believe that implementing a check for the existence of 'globalThis' before its usage could resolve this issue.