We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I use the latest version of Tanstack Query with the latest version of Preact, I am not able to write a working unit test.
In short, when I render() any JSX wrapped in a <QueryClientProvider> as per the Testing section of the docs, I get this error:
render()
<QueryClientProvider>
TypeError: Cannot read properties of null (reading 'useEffect') ❯ Module.process.env.NODE_ENV.exports.useEffect node_modules/react/cjs/react.development.js:1473:33 ❯ x.constructor node_modules/@tanstack/react-query/src/QueryClientProvider.tsx:33:9 ❯ x.render node_modules/preact/src/diff/index.js:659:14 ❯ diff node_modules/preact/src/diff/index.js:240:14 ❯ diffChildren node_modules/preact/src/diff/children.js:96:16 ❯ diff node_modules/preact/src/diff/index.js:262:13 ❯ diffChildren node_modules/preact/src/diff/children.js:96:16 ❯ diff node_modules/preact/src/diff/index.js:262:13 ❯ D node_modules/preact/src/render.js:42:2 ❯ node_modules/@testing-library/preact/dist/esm/pure.mjs:48:7 46| preactHydrate(wrapUiIfNeeded(ui), container); 47| } else { 48| preactRender(wrapUiIfNeeded(ui), container); | ^ 49| } 50| });
Whereas when I remove the <QueryClientProvider> wrap, then the JSX renders.
I wrote a minimal reproducible test case here:
https://github.com/philipmw/testing-tanstack-query-with-preact
npm test
unit tests pass.
Every time
No response
macOS, jsdom environment of vitest
react-query
5.64.2
5.4.5
The text was updated successfully, but these errors were encountered:
+1
Sorry, something went wrong.
No branches or pull requests
Describe the bug
When I use the latest version of Tanstack Query with the latest version of Preact, I am not able to write a working unit test.
In short, when I
render()
any JSX wrapped in a<QueryClientProvider>
as per the Testing section of the docs, I get this error:Whereas when I remove the
<QueryClientProvider>
wrap, then the JSX renders.I wrote a minimal reproducible test case here:
Your minimal, reproducible example
https://github.com/philipmw/testing-tanstack-query-with-preact
Steps to reproduce
npm test
Expected behavior
unit tests pass.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
macOS, jsdom environment of vitest
Tanstack Query adapter
react-query
TanStack Query version
5.64.2
TypeScript version
5.4.5
Additional context
No response
The text was updated successfully, but these errors were encountered: