-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
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
"Unable to resolve module ./useInifinteQuery.cjs" #8070
Comments
Same Issue !!! have you got the solution to this problem as it is not consoling the pageParam it is always showing undefined |
I also don’t know where to start because if the reproduction works, it’s likely a setup issue. We make special builds for “legacy” bundlers that don’t understand (or misinterpret) ESM. Whatever bundler you are using, it picks up the legacy, commonJs build from the query/packages/react-query/package.json Line 37 in 763abd1
but then, it seems to not understand the
but not CJS. If the bundler were to understand a ESM, but not package.json exports, it would at least pick up the query/packages/react-query/package.json Line 38 in 763abd1
all in all, maybe we are not compatible with react-native 0.73, I really don’t know. Please try upgrading to 0.75 or downgrade react-query to v4. |
okay seems like you’re using metro: this was fixed: and there’s a workaround: |
Describe the bug
I'm not sure whether this is a bug or just me doing something wrong. I have a React Native project (using React 18.2.0 and React Native 0.73.6) which also uses TypeScript (5.0.4). I've just added React Query ("@tanstack/react-query": "^5.56.2"), and attempted to create an infinite query like this:
When I try to run this (on Android - haven't tried iOS yet) I get the error
`Error: Unable to resolve module ./useInfiniteQuery.cjs from C:\PATH\TO\PROJECT\node_modules@tanstack\react-query\build\legacy\index.cjs:
None of these files exist:
63 | var import_useMutationState = require("./useMutationState.cjs");
64 | var import_useMutation = require("./useMutation.cjs");
followed by a second error:
I'm totally new to React Query, so I may well be doing something wrong, but I don't know where to start. I've provided a Snack below, but it seems to work ok there, so that doesn't really help.
Your minimal, reproducible example
https://snack.expo.dev/@sharongilmore/moody-blue-milkshake
Steps to reproduce
Run the code
Expected behavior
I expected it to show a blank screen
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
Windows 11 Pro
Android Emulator (API 33)
Tanstack Query adapter
react-query
TanStack Query version
v5.56.2
TypeScript version
5.0.4
Additional context
No response
The text was updated successfully, but these errors were encountered: