-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Warning with @reduxjs/toolkit/query/react Is this an Expo or RTK issue? #4524
Comments
Hmm. That could mean we need to tweak the nested What version of the Metro bundler are you using? Does the app build and run overall? |
What version of Expo and React-Native are you using? What version of |
Thank you @markerikson for the explanation.
Expo: ~51.0.22 This is my package.json {
"name": "demo-frontend",
"main": "expo-router/entry",
"version": "1.0.0",
"scripts": {
"start": "expo start",
"reset-project": "node ./scripts/reset-project.js",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"test": "jest --watchAll",
"lint": "expo lint"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"@expo/vector-icons": "^14.0.2",
"@react-navigation/native": "^6.0.2",
"@reduxjs/toolkit": "^2.2.6",
"expo": "~51.0.22",
"expo-constants": "~16.0.2",
"expo-font": "~12.0.9",
"expo-linking": "~6.3.1",
"expo-router": "~3.5.18",
"expo-splash-screen": "~0.27.5",
"expo-status-bar": "~1.12.1",
"expo-system-ui": "~3.0.7",
"expo-web-browser": "~13.0.3",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-native": "0.74.3",
"react-native-gesture-handler": "~2.16.1",
"react-native-reanimated": "~3.10.1",
"react-native-safe-area-context": "4.10.5",
"react-native-screens": "3.31.1",
"react-native-web": "~0.19.10",
"react-redux": "^9.1.2"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@types/jest": "^29.5.12",
"@types/react": "~18.2.45",
"@types/react-test-renderer": "^18.0.7",
"jest": "^29.2.1",
"jest-expo": "~51.0.3",
"react-test-renderer": "18.2.0",
"typescript": "~5.3.3"
},
"private": true
} |
@akeeee Are you using a monorepo of some kind? And what command do you run before you get the warning? Is it just |
@aryaemami59 No, I just install Expo (npx create-expo-app@latest) and set up the store. You can check the repository here: https://github.com/akeeee/reduxjs-warning. You can run with |
@akeeee Thanks for the repro, I'll take a look. I did some digging earlier it looks like the |
@aryaemami59 Thank you for your time. I use node v20.9.0 btw. |
@akeeee Awesome, thanks I'll take a look. |
Alright I did some more digging and I think I might have a solution for this. If the only reason we kept the nested "typesVersions": {
"*": {
"react": [
"./dist/react/index.d.ts"
],
"query": [
"./dist/query/index.d.ts"
],
"query/react": [
"./dist/query/react/index.d.ts"
]
}
}, I tried this already, it seems to work on TypeScript's side of things. The warning goes away in the provided repro and it passes the are-the-types-wrong tests. I did actually take it one step further, I noticed the React-Redux package has an |
FWIW, those nested |
ahhh, I see. I'm going to look into this a bit more but I think the main issue is that the |
I had a similar issue, I upgraded to latest expo SDK v51, I had to delete my |
@aryaemami59 Hey there. Has there been any further investigation into this issue? We're going through the process of updating to RTK v2, and I'm experiencing the same warnings as the OP. We have the warning: The package /node_modules/@reduxjs/toolkit/query contains an invalid package.json configuration. Consider raising this issue with the package maintainer(s).
Reason: The target for "." defined in "exports" is "./../dist/query/rtk-query.modern.mjs", however this value is an invalid subpath or subpath pattern because it includes "..". Falling back to file-based resolution. Node: 18.5.0 |
@jrjacobs24 No, sorry I kind of lost track of this, I'll take another look today. |
Describe the bug
When using Expo with
@reduxjs/toolkit/query/react
, I encounter the following warning:warning: The package /node_modules/@reduxjs/toolkit/query/react contains an invalid package.json configuration.
Consider raising this issue with the package maintainer(s).
Reason: The target for "." defined in "exports" is "./../../dist/query/react/cjs/index.js", however this value is an invalid subpath or subpath pattern because it includes "..". Falling back to file-based resolution.
Questions
The text was updated successfully, but these errors were encountered: