expo: Expo 25 remote debugging doesn't work on native device
when I create a brand new project from Expo XDE, I try turning on remote debugging on a native ios device and I get the following error:
Failed to load http://packager.62-wdi.lifeiscontent.my-new-project.exp.direct/node_modules/expo/AppEntry.delta?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=/Users/aaronreisman/my-new-project/node_modules/expo/tools/hashAssetFiles: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:19001' 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.
(index):188 Uncaught (in promise) TypeError: Failed to fetch
this is using the react-navigation project base.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 17
- Comments: 24 (3 by maintainers)
@psyanite just change in crome the url in chrome from localhost:19001/debugger-ui to http://192.168.1.5:19001/debugger-ui
It seems a RN 0.52 issue: https://github.com/facebook/react-native/issues/17618 In the issue, they mentioned it might be fixed in 0.53.
Potential workaround by Sw0rdstream:
szmarci Try to install CORS toggle extension, it helped me with similar problem
@fotoflo this error happening because of Access-Control-Allow-Origin headers is missing. To fix this issue download CORS toggle extension from chrome webstore and install it CORS toggle extension
in right side corner of debug tab of chrome (near book mark star icon ) a CORS icon in red color will appear just click that icon to toggle enable or disable CORS. once you enable it it color will be green now reload the debug tab. Access-Control-Allow-Origin error will go away this time
A fix for this issue will be included with React Native 0.53 and Expo SDK 26. The ETA for SDK 26 is before March.
As a workaround in SDK 25, you can use the LAN IP or localhost (w/simulator) options instead of the “tunnel” option in exp/XDE. Configuring your environment to work without the tunnel is faster too: https://docs.expo.io/versions/latest/guides/debugging.html#to-ensure-the-best-debugging-experience-first-change-your-host-type-in-xde-to-lan-or-localhost-if-you-use-tunnel-with-debugging-enabled-you-are-likely-to-experience-so-much-latency-that-your-app-is-unusable-while-here-also-ensure-that-development-mode-is-checked
Hi, am I using the same thing as what’s being reported in this thread?
Sorry, but I can’t find the debug tab, could anyone please provide more detailed instructions for a workaround?
Thank you in advance
Hey all, we’re still planning on including a fix for this (as part of updated React Native) with our next SDK. As mentioned on our blog, we’ve delayed SDK 26, so I just wanted to mention that here so people aren’t wondering. Sorry about the delay.
How exactly would debugging work? I don’t have my source files listed in the Sources panel.
I had the same issue, the answer of @felipefreitag worked for me. Just in the debug tab in chrome, change the localhost to 192.xxx.xxx.xx of the error in the console.