question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expo dev client can only connect with running dev server and not static files hosted using expo export

See original GitHub issue

Summary

Currently the custom development client can only connect to a running dev server. (Unlike expo go). Connecting to static files served with Nginx only works with Expo Go, not with a custom development client

Managed or bare workflow? If you have made manual changes inside of the ios/ or android/ directories in your project, the answer is bare!

bare

What platform(s) does this occur on?

Android, iOS

Package versions

    "expo-dev-client": "^0.4.4",
    "expo-dev-launcher": "^0.6.4",
    "expo-dev-menu-interface": "^0.3.2",

Environment

  Expo CLI 4.9.1 environment info:
    System:
      OS: Linux 5.11 Ubuntu 21.04 (Hirsute Hippo)
      Shell: 5.8 - /usr/bin/zsh
    Binaries:
      Node: 14.17.1 - /usr/bin/node
      Yarn: 1.22.10 - ~/projects/differentlab/mobile-react/node_modules/.bin/yarn
      npm: 7.19.1 - /usr/bin/npm
    npmPackages:
      expo: ^42.0.0 => 42.0.1 
      react: 16.13.1 => 16.13.1 
      react-dom: 16.13.1 => 16.13.1 
      react-native: ~0.63.4 => 0.63.4 
      react-native-web: ~0.13.12 => 0.13.18 
    npmGlobalPackages:
      expo-cli: 4.7.3
    Expo Workflow: bare

Reproducible demo or steps to reproduce from a blank project

Use expo export to generate static files. Host it using either a local php/nginx/python server. Connect to it. Won’t work with your custom dev client but it does with Expo GO

Stacktrace (if a crash is involved)

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
esamelsoncommented, Aug 4, 2021

Hey @Silvest89 - thanks for the report! We’re working on a fix for this, hang tight.

0reactions
esamelsoncommented, Aug 30, 2021

I’m not able to reproduce this with a python SimpleHTTPServer; when I open http://0.0.0.0:8000/ios-index.json the response comes back with a content-type of application/json and my development client opens the app correctly. If you’re still having issues with this, I’d suggest verifying that the content-type of the response is correct.

The reason that Expo Go behaves differently is because custom clients also have the ability to load bundles from a plain react-native server (npx react-native start), which means we need to infer more information from the content-type header as not much other information is available from this kind of server.

Let us know if there are other content-type values that you’re expecting to work, but are causing this error in your client.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Host your Expo app anywhere
Export your app​​ Here's how the process works in 3 simple steps: Create an Expo app and install expo-cli ( npm install -g...
Read more >
Network Response Time Out Error (create-react-native-app ...
Solution 1:- Connect both(your PC and mobile)with same network then scan the QR with expo application. Solution 2:-Select / change connection ...
Read more >
Networking - React Native
You may want to make a POST request to a REST API, or you may need to fetch a chunk of static content...
Read more >
Get started with Firebase Hosting - Google
To connect your local project files to your Firebase project, run the following command from ... list in the flag (for example, --only...
Read more >
Doing More with Expo: Using Custom Native Code - SitePen
Unfortunately, using the managed flow has traditionally required apps to stick to whatever set of native extensions are in the Expo Go client; ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found