-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
0.52 - CORS issue with JS Remote Debugging when using xip.io #17618
Comments
Did some digging, and found that if I modify https://github.com/facebook/metro/ |
Just had to double check if it was indeed introduced since https://github.com/njbmartin/react-native-xip/tree/v.0.51 |
Hi @njbmartin, You've saved my life! I've upgraded to 0.52.0 as well and noticed that it wouldn't run on iOS with Remote Debugger On. The 0.52.0 release seems to be quite buggy. I already wasted quite a few hours fighting with another issue that wouldn't let me build an app - #17274. So, could you possibly change the title of this issue to something more alarming, so that the react-native maintainers notice it? Something like "Remote Debugging Doesn't Work on 0.52.0"? |
I met the same problem on 0.52.0。 |
I have same issue. |
Facing the same issue with 0.52. |
Facing the same without xip.io, just with IP-address of my Macbook while running application on device per ip-address of my working machine. It happens only when debug-mode was enabled and failed then to load the code. Without debug-mode everything works as expected:
I have already whitelisted this IP-Address and also localhost in Info.plist:
But it still appears. At the end the ReactNative Application can't load its code while Debug-Mode is enabled. Without debug mode everything works as expected. Any ideas? |
This is happening to me as well rn 0.52.0 only when debugging js remotely |
Same here 🤙 But I fixed with downgrade react-native to 0.51.0 Cause I do not have enough time for waiting PR. Respects. |
Same here, I downgraded to react-native to 0.51.0 and react to 16.0.0 it works well in iOS Simulator even with the inspector on, but if I try to run in a real device (iPhone 7) I still got the issue. |
@luanfelipecosta I did not downgraded react to 16.0.0, it works in real (iPhone 7) device. You should try upgrade react. |
I've downgraded to react-native@0.51.0 & react@16.0.0, I'm getting the issue still - No idea but could this be a chrome related? Chrome: Version 63.0.3239.132 |
I'm not sure it is Chrome related, as I was able to downgrade to 0.51 and it works just fine. Take a look at the screenshots above. Something, somewhere, is adding |
As an even better workaround... replace Voted not the best solution... |
That's not usable for daily development environment. @njbmartin |
I'm having the same issue on:
Simply downgrading to React-Native 0.51.0 (by just running Remember that, after downgrading, you should also reset the cache: |
I'm using CRNA and for a workaround I used http://10.0.0.2:19001/debugger-ui/ where 10.0.0.2 is my LAN Ip address |
👍 +1 on this, same issue for me: "Failed to load http://10.0.1.57.xip.io:8081/index.delta?platform=ios&dev=true&minify=false: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8081' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled. |
For those having an issue with this, please check out the PR #17720 and see if that fixes the issue for you. |
As a workaround, simply change your URL of Chrome from http://localhost:8081/debugger-ui/ to http://192.168.XXXX.XXXX.xip.io:8081/debugger-ui/ In @njbmartin 's case, http://192.168.0.13.xip.io:8081/debugger-ui/ |
Same issue with 0.52... Critical bug for me. I think we are also going to downgrade RN 0.51 |
Facing this issue even in 0.53. I have to use the IP address of my computer instead of localhost |
Summary: <!-- Thank you for sending the PR! We appreciate you spending the time to work on these changes. Help us understand your motivation by explaining why you decided to make this change. You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html Happy contributing! --> See #17618 On certain networks, `xip.io` is used, but as the debugger will always using localhost a change upstream has resulted in a CORS issue (see screenshots in #17618). This change ensures that the debugger will always open with whatever configuration. > This should be merged in as a patch of `0.52.x` as it affects current release, and `0.51.x` didn't have this issue. Tested locally, could do with the people having the same issue in #17618 testing it out prior to merging. (If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/react-native-website, and link to your PR here.) <!-- Help reviewers and the release process by writing your own release notes **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.** CATEGORY [----------] TYPE [ CLI ] [-------------] LOCATION [ DOCS ] [ BREAKING ] [-------------] [ GENERAL ] [ BUGFIX ] [-{Component}-] [ INTERNAL ] [ ENHANCEMENT ] [ {File} ] [ IOS ] [ FEATURE ] [ {Directory} ] |-----------| [ ANDROID ] [ MINOR ] [ {Framework} ] - | {Message} | [----------] [-------------] [-------------] |-----------| [CATEGORY] [TYPE] [LOCATION] - MESSAGE EXAMPLES: [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see --> [CLI] [BUGFIX] [local-cli/server/middleware/getDevToolsMiddleware.js] - Prevents JS Debugger issues with CORS Closes #17720 Differential Revision: D6828205 Pulled By: hramos fbshipit-source-id: 7e5d43db9faf7edc9444ba4214aca1a18e25dbd2
Same problem here. Follow Sw0rdstream work around fixed for me. |
Been getting this since about the same time this Issue appeared (Jan 15). Any time I create a CRNA app and try to debug it with Chrome. To get by, I would downgrade Expo and react native to previous versions: EXPO SDK to 24, React to 16.0.0, React Native to 0.51.x (matching the row shown for Expo SDK version 24.0.0. at https://github.com/react-community/create-react-native-app/blob/master/VERSIONS.md). I hadn't created a new CRNA app for a few weeks until today. Tried it and got the same thing. Came back here to see if there was any new news and saw the Google CORS Toggle suggestion from @luanfelipecosta. As others have reported, it works great. Hopefully this problem will get resolved before long, but until then, the CORS toggle is a quick and painless fix. Thanks @luanfelipecosta! |
CORS Toggle might work great, but they ask for the permission "Read and change all your data on the websites that you visit" |
@dgrcode you can find the source of it here (+ build it yourself) if you're worried; https://github.com/demesne/cors-toggle |
|
Try to install CORS toggle extension, it helped me with similar problem |
I updated to |
i have this error on mac with i installed CORS toggle extension as @julioe says and now i can run in debug mode but with a lot of |
@MaxInMoon I still have this issue in 0.54.0-rc.3. I had to get that version because of another issue on 0.54.4. @julioe's fix worked for me as well! It seems to disable CORS for every tab though, not exactly safe. @alainib These warnings are intended and expected behavior. See this blog post |
Using |
Thanks @akash-cp it worked! |
rayronvictor style solved my problem too. |
disabling the CORS plugin in chrome made it work! |
@roadev how to disabling the CORS plugin? thanks. |
@HFmoney Just ... click on it (on the chrome plugins bar - right side) and disable the "Enable cross-origin resource sharing". |
The solution for this problem is simply install the extension "Allow-Control-Allow-Origin" in your chrome browser. this works for me you all can try. |
@arfa123 You save my day! Thanks. The extension "Allow-Control-Allow-Origin" . |
like @rayronvictor Using |
IDK why it's happening with 0.53. For now we can proceed with |
I'm having this issue with RN 0.55.4. Localhost or my machine's IP didn't work. The only thing that worked for me was disabling CORS via the chrome extension. |
didn't work for me. |
problem solved, it's work me. http://localhost:8081/debugger-ui/ |
Note that http://127.0.0.1:8081/debugger-ui/ specifically doesn't seem to work, for CORS reasons. |
In my case it is solved by deleting in Application debug menu "Dev Stettings" -> "Debug server host & port for device" erase all ip and port. after that it works again. JS Debug Remotly. |
Working with RN 0.55.4, Iphone 12.1.1, google chrome latest as of Dec, 2018. |
Adding this Extension to Chrome solves this issue: |
Is this a bug report?
Yes.
Have you read the Contributing Guidelines?
Yes.
Environment
Environment:
OS: macOS High Sierra 10.13.2
Node: 9.4.0
Yarn: Not Found
npm: 5.6.0
Watchman: 4.9.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.0 AI-171.4443003
Packages: (wanted => installed)
react: ^16.2.0 => 16.2.0
react-native: ^0.52.0 => 0.52.0
Target Platform: iOS 8
Steps to Reproduce
http://192.168.0.13.xip.io:8081/index.delta?platform=ios&dev=true&minify=false
http://localhost:8081/debugger-ui/
in Chrome.Expected Behavior
App should load correctly and not throw an error when trying to debug JS remotely.
Actual Behavior
Reproducible Demo
(Paste the link to an example project and exact instructions to reproduce the issue.)
https://github.com/njbmartin/react-native-xip
The text was updated successfully, but these errors were encountered: