Closed brettchalupa closed 9 months ago
Ye, not sure how Next wants that to work but it injects a custom React version when running next
😅 so I think to test out server-components you might need to use the canary
React version or something similar that supports React.cache
.
There are some folks over here providing solutions.
Describe the bug
When adding urql to a Next.js project using Jest to test the React components, the call to
registerUrl
(as per the docs) fails with this error:TypeError: React.cache is not a function
the error
repro steps
the error is able to reproduced in isolation by creating a new Next.js app with Jest and adding urql.
npx create-next-app@latest --example with-jest with-jest-app
cd with-jest-app
npm install --save @urql/next urql graphql
npx jest
fails with the above errorkey versions
Reproduction
https://github.com/brettchalupa/next-urql-jest-react-cache-repro
Urql version
urql: 4.07 @urql/next: 1.0.1
Validations