Create-react-native-app: Unable to debug app with 'No 'Access-Control-Allow-Origin' header is present' error

Created on 31 Jan 2018  路  6Comments  路  Source: expo/create-react-native-app

When I start up my Android Samsung S8+ device over wifi or Genymotion S8 emulator on the same machine to access the expo project using expo XDE, in the Chrome console, I see the following errors:

Failed to load http://192.168.1.6:19004/node_modules/expo/AppEntry.delta?platform=android&dev=true&strict=false&minify=false&hot=false&assetPlugin=G:\Projects\bt\ff\node_modules\expo\tools\hashAssetFiles: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:19004' 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.
Uncaught (in promise) TypeError: Failed to fetch

I believe this could potentially be caused by updating sdkVersion from 24.0.0 to 25.0.0. @brentvatne Do you have any idea? Does anyone not have this issue?

I believe it could be related to this issue reported 9 days ago which seems similar to what @jugutier has:
https://github.com/facebook/react-native/issues/17618

I can't debug and see what's happening on Redux 馃槶

Okay, I think the CORS error that @jugutier and I are experiencing is different to the original issue...

It won't let me downgrade to 24.0.0 馃槶 If anyone knows how I can downgrade to 24.0.0 please let me know.

A few other users have reported this issue on this thread:
https://github.com/react-community/create-react-native-app/issues/392

And also here:
https://github.com/expo/expo/issues/1351

If this is an issue that is a duplicate of https://github.com/expo/expo/issues/1351, please feel free to close this issue.

Most helpful comment

try to install the extension "Allow-Control-Allow-Origin" in your chrome browser, from this my problem is solved, you may try this.

All 6 comments

this is an issue that occurred upstream with react native and the fix will ship in the next Expo SDK. Sorry for the inconvenience!

@quinlanj Thanks!

Workarounds are provided https://github.com/expo/expo/issues/1351#issuecomment-361932735, but not sure if they will work with mobile apps.... If anyone knows how any workarounds with the app please let me know.

@psyanite Worked for me! 馃檹馃徑

try to install the extension "Allow-Control-Allow-Origin" in your chrome browser, from this my problem is solved, you may try this.

@arfa123 Or simply use React Native Debugger :)

@arfa123 you save me

Was this page helpful?
0 / 5 - 0 ratings