react-native-netinfo: Error Access to XMLHttpRequest on 4.1.0
Environment
System: OS: macOS 10.14.6 CPU: (12) x64 Intel® Core™ i7-8850H CPU @ 2.60GHz Memory: 56.77 MB / 16.00 GB Shell: 5.3 - /bin/zsh Binaries: Node: 11.10.0 - ~/.nvm/versions/node/v11.10.0/bin/node Yarn: 1.16.0 - ~/.yarn/bin/yarn npm: 6.10.0 - ~/.nvm/versions/node/v11.10.0/bin/npm SDKs: iOS SDK: Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2 Android SDK: API Levels: 23, 25, 26, 27, 28 Build Tools: 27.0.3, 28.0.2, 28.0.3, 29.0.0 System Images: android-24 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom_64, android-28 | Google Play Intel x86 Atom, android-28 | Google Play Intel x86 Atom_64 IDEs: Android Studio: 3.4 AI-183.6156.11.34.5692245 Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild npmPackages: react: ^16.8.6 => 16.8.6 react-native: 0.60.3 => 0.60.3
Platforms
iOS
Versions
- react-native-netinfo: 4.1.0
- react-native: 0.60.3
- react:16.8.6
Description
Getting error:
Access to XMLHttpRequest at 'https://clients3.google.com/generate_204' from origin 'http://localhost:8081' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
On version 4.1.0
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 18
If that is the case, then I am going to close the issue without a fix. This is because you are making modifications to how networking is happening in React Native which changes the default behaviour and is not supported by this library. It also does not affect the library when used in production, so I don’t think we should complicate the library by supporting the use case.
As an alternative to modifying how network requests are done, you can monitor network requests in any of these supported way:
Let me know if this bug is caused by something other than modifying the React Native behaviour and I will take a look into it.
@ameernormie You can ignore this in reactotron configuration.
👋 Just to confirm, is this happening when you have remote debugging enabled?
Rather than just saying “same”, is someone able to provide a reproducible project for this issue?
As mentioned above, I have looked into this and wasn’t able to reproduce it. However, as other are mentioning it, it must be an issue.
If you are not able to provide a a demo, then please don’t comment as it just causes unnecessary emails for people to deal with. Instead, just leave a 👍 reaction and subscribe to the issue for updates.