query: V4 does not log anything in react-native even when not in production
Describe the bug
When using react-query v4 with react-native, nothing is logged to the console, even when during development.
For instance when a query function throws an error, the error is not logged.
Your minimal, reproducible example
https://snack.expo.dev/@matthieugc/react-query-v4-no-logs-repro
Steps to reproduce
Have a query that throws an error
Expected behavior
Expected: the error is logged by react-query Happening: nothing is logged
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
- React Native 0.69.3
react-query version
4.0.10
TypeScript version
No response
Additional context
Here’s why this seems to be happenning:
The package.json for react-query (and query-core) v4 contains these fields:
And metro, the react-native bundler, uses the browser field in priority when it’s available
→ For react-query, it points to the UMD production build, where the default logger calls have been removed during bundling
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 16 (5 by maintainers)
@TkDodo Yes, we can also bump the version of beta tag forcefully via actions menu to be greater than current main version. Whatever works for you.
@TkDodo Unfortunately, I wasn’t able to reproduce this in codesandbox with simple react app. However, I created demo repository with Next.js: https://github.com/vanniewelt/react-query-no-logging-error-demo
@DamianOsipiuk I tried it and no luck