T
TanStack•3y ago
xenophobic-harlequin

React Native tests fail: `require(...).unstable_batchedUpdates` is not a function

Hi there! After migrating to react-query v4, our React Native tests fail in CI environment with following error:
ReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From ...
at unstable_batchedUpdates (node_modules/react-native/Libraries/ReactNative/RendererImplementation.js:44:10)
at batchNotifyFn (node_modules/@tanstack/query-core/src/notifyManager.ts:61:9)
node_modules/react-native/Libraries/ReactNative/RendererImplementation.js:44
return require("../Renderer/shims/ReactNative").unstable_batchedUpdates(fn, bookkeeping);
^
TypeError: require(...).unstable_batchedUpdates is not a function
at unstable_batchedUpdates (node_modules/react-native/Libraries/ReactNative/RendererImplementation.js:44:51)
at batchNotifyFn (node_modules/@tanstack/query-core/src/notifyManager.ts:61:9)
ReferenceError: You are trying to `import` a file after the Jest environment has been torn down. From ...
at unstable_batchedUpdates (node_modules/react-native/Libraries/ReactNative/RendererImplementation.js:44:10)
at batchNotifyFn (node_modules/@tanstack/query-core/src/notifyManager.ts:61:9)
node_modules/react-native/Libraries/ReactNative/RendererImplementation.js:44
return require("../Renderer/shims/ReactNative").unstable_batchedUpdates(fn, bookkeeping);
^
TypeError: require(...).unstable_batchedUpdates is not a function
at unstable_batchedUpdates (node_modules/react-native/Libraries/ReactNative/RendererImplementation.js:44:51)
at batchNotifyFn (node_modules/@tanstack/query-core/src/notifyManager.ts:61:9)
Has anybody experienced this error? I've tried using waitFor in tests, but it didn't help 😦
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?