-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
React-Native-Web. Build Error - Unable to resolve "./RCTNetworking" #2734
Comments
Here is some more information When i run npx expo start --web -c i'm able to resolve this by updating my metro.config.js
https://facebook.github.io/metro/docs/configuration But when i bundle and serve the app I get various issues. For example index-fae72be5f22c92931a109296bd504de0.js:5417 TypeError: Cannot read properties of undefined (reading 'node') which comes from the identify-obj-proxy dependency. But if I fix that then i get TypeError: r(...).default.addListener is not a function which comes from node_modules/react-native/Libraries/Network/XMLHttpRequest.js
I feel like I've tried everything. If anyone has any tips for this it would be super appreciated! |
Follow up. This worked after updating my react-native to |
Is there an existing issue for this?
Describe the issue
When I'm trying to build the project I run into the error
Unable to resolve "./RCTNetworking" from "node_modules/react-native/Libraries/Network/XMLHttpRequest.js"
Seems like the issue is node_modules/react-native/Libraries/Network directory has an RCTNetworking.android.js and RCTNetworking.ios.js but the metro.config.js can't find a corresponding file for web.
I have a dependency that makes my API requests with axios (that i access from my npm module / not directly from my app components/stores.
I've tried mocking out the RCTNetworking but can't seem to get anything to work. It will either not make the request or will fail with the same import error.
For instance if I do
It hides the error on build but I can't make HTTP calls and gives me the following error when I try to make an API request
Expected behavior
Would expect to compile and be able to make API requests.
Steps to reproduce
"react-native": "0.74.2",
"expo": "^51.0.0"
Test case
N/A
Additional comments
No response
The text was updated successfully, but these errors were encountered: