expo: Expo start tunnel failed to start tunnel
Summary
Expected
When running expo start -c --tunnel it should start up a tunnel
Actual
I get this error message:
yarn start -c --tunnel 19:23:35
yarn run v1.22.18
warning ../../../../package.json: No license field
$ expo start --dev-client -c --tunnel
Starting project at /Users/adriancaroll/workspace/github/ligonier/ligonier-app
Starting Metro Bundler
warning: Bundler cache is empty, rebuilding (this may take a minute)
watchman warning: Recrawled this watch 7 times, most recently because:
MustScanSubDirs UserDroppedTo resolve, please review the information on
https://facebook.github.io/watchman/docs/troubleshooting.html#recrawl
To clear this warning, run:
`watchman watch-del '/Users/adriancaroll/workspace/github/ligonier/ligonier-app' ; watchman watch-project '/Users/adriancaroll/workspace/github/ligonier/ligonier-app'`
CommandError: failed to start tunnel
remote gone away
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
What platform(s) does this occur on?
Android, iOS, Web
Environment
expo-env-info 1.0.5 environment info:
System:
OS: macOS 13.3.1
Shell: 3.2.2 - /usr/local/bin/fish
Binaries:
Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node
Yarn: 1.22.18 - ~/.nvm/versions/node/v16.13.0/bin/yarn
npm: 8.1.0 - ~/.nvm/versions/node/v16.13.0/bin/npm
Watchman: 2022.10.17.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
Android SDK:
API Levels: 29, 30
Build Tools: 29.0.2, 30.0.3
System Images: android-29 | Intel x86 Atom, android-29 | Intel x86 Atom_64, android-30 | Google APIs Intel x86 Atom
IDEs:
Android Studio: 4.1 AI-201.8743.12.41.7199119
Xcode: 14.3/14E222b - /usr/bin/xcodebuild
npmPackages:
expo: ~47.0.14 => 47.0.14
react: 18.1.0 => 18.1.0
react-dom: 18.1.0 => 18.1.0
react-native: 0.70.8 => 0.70.8
react-native-web: 0.18.9 => 0.18.9
npmGlobalPackages:
eas-cli: 3.9.1
expo-cli: 6.3.2
Expo Workflow: bare
Minimal reproducible example
Simply run the following in a terminal:
expo start -c --tunnel
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 31
- Comments: 74 (7 by maintainers)
This is really hammering my ability to work.
Investigating now.
Just a few quick things to try and mitigate the duplicate comments that may be throwing people off:
--clearclears the babel cache and has no overlap with tunneling a URL.--dev-clientchanges the port of the URL this also should have no sway over ngrok working or not.Update 1
The Expo account may have been suspended, I don’t see any clear indication of that outside of the error code which seems to be related to suspension.
Users can change the API token in Expo CLI to use their own account as a temporary workaround. This file is located under
node_modules/@expo/cli/build/src/start/server/AsyncNgrok.js– haven’t confirmed if this works yet.Update 2
Confirmed the temporary workaround works:
node_modules/@expo/cli/build/src/start/server/AsyncNgrok.js:The resulting URL will look something like
exp://1419-72-181-50-55.ngrok-free.appYou can use
npx patch-package @expo/clithen add the script"prepare": "npx patch-package"to yourpackage.jsonscriptsobject to keep this change working across installs.EXPO_TUNNEL_SUBDOMAINset.Still investigating why the official token is no longer working.
Update 3
We have been able to contact Ngrok and get the default key reinstated. Tested and I can confirm it works. If you added the patch, you can now revert it to the default key.
Sorry for any inconvenience they may have caused.
Access to the Expo Ngrok account has been restored and the
--tunnelfunctionality is now working again, no workarounds necessary, sorry for the inconvenienceeveryone. stop making unnecesary comments. asking if it’s fixed or saying you have the same problem only causes more spam for those of us actually waiting for a fix. if you have nothing to add, upvote the original post and / or suscribe to the issue to get notified of updates
I have the same error and started arout the same time this post was posted.
This has now been resolved: https://github.com/expo/expo/issues/22186#issuecomment-1514852974
I was having this issue too, seems to be resolved now for me, using
"expo":"~47.0.13"Update: this resolved it temporarily but it’s failing again, switches between these 2 error messages
CommandError: TypeError: Cannot read properties of undefined (reading 'body')CommandError: failed to start tunnel remote gone awayThank you for filing this issue! This comment acknowledges we believe this may be a bug and there’s enough information to investigate it. However, we can’t promise any sort of timeline for resolution. We prioritize issues based on severity, breadth of impact, and alignment with our roadmap. If you’d like to help move it more quickly, you can continue to investigate it more deeply and/or you can open a pull request that fixes the cause.
Also having this issue. Started tonight.
Roll back to
"expo": "~48.0.6",from48.0.10in package.json to get this working again.Same for me. Was working yesterday, April 18, but started bugging over the night (11 PM CET). This morning, tried updating node modules, react, react native, ngrok Initially got ngrok error message. Worked once this morning, and failed again. Now after reinstalling node modules getting
CommandError: TypeError: Cannot read properties of undefined (reading ‘body’)
or
CommandError: ngrok tunnel took too long to connect.
Good morning,
It still doesn’t work. It’s starting to get really blocking, can we have some news please?
Same here. I get two messages occasionally:
or
tunnel stops working for me today as well
session closed tunnel took to long to connect Cannot read properties of undefined (reading ‘body’)
help-
I just got this today too:
Starting Metro Bundler CommandError: failed to start tunnel
remote gone away
Edit: It is now working after waiting for some time… I have not done anything… strange
Edit 2:
Same experience
@acognigni-evotecnia solution updated
is it possible that the update 2 solution only works if you have a paid account?
i’m getting an error saying
Only Personal, Pro and Enterprise plans may bind custom hostnames. Failed to bind the custom hostname 'qi6m2ew.anonymous.19001' for the account 'my@email.com'. This account is on the 'Free' plan.It’s still not working for me. Based on the comments above, it sounds like this server has been going up and down throughout the day yesterday.
This is an interesting dependency that I didn’t know I had in my development flow. I’m trying to figure out how to work around it. I normally run
npx expo start --dev-client --tunneland that causes the issue, but when I drop the--tunnelcommand then the server starts up. But when I scan the QR code it’s trying to direct to https://127.0.0.1:8081 which is not visible to the outside so it fails.Notably, expo is using ngrok for it’s tunnel. But ngrok is not down. I’ve downloaded the ngrok NPM module directly, created an account, and I’m able to start up a tunnel to my machine and another local web server that I start up.
I just can’t figure out how to get expo to use my existing tunnel rather than its own. Maybe this is just a QR code thing? I’m still digging, but sharing this in case anyone else has ideas…
Same Problem …
Any fixes yet, cause I have been facing this issue since morning.
Can it be a problem in @expo/ngrok?
I am also facing the same issue: CommandError: failed to start tunnel
remote gone away
Please help me to solve this issue.
Same issue here.
yarn start tunnelwas working yesterday but now it doesn’t anymore.Having the same problem here in Zimbabwe.
` Starting Metro Bundler warning: Bundler cache is empty, rebuilding (this may take a minute) CommandError: failed to start tunnel
remote gone away `
same issue today , falling back to LAN URL!
same problem, need it to continue development
Having the same problem here in Spain.
` Starting Metro Bundler warning: Bundler cache is empty, rebuilding (this may take a minute) CommandError: failed to start tunnel
remote gone away `
Experiencing the same following errors:
None of the provided temporary solutions have worked. Anyone find a working solution?
Same here
same here
This is useful for now, thanks friend
bruh that just worked, youre a lifesaver, been on this the whole day
Oh wait, success! On my dev machine which has no ports exposed to the outside, I open two terminal windows. In one:
In the other I run:
In my iOS Expo Go build there is a place to enter URL manually. I give it:
http://keith-expo.ngrok.io/The placeholder text there suggests that you can enter a port after the URL, but I’m finding that it’s ignored every time so the steps above were what I had to do in order to get everything listening and responding on port 80.
I had this problem too, but I made a QR code with
exp://[My-lan-ip]:[port]and I can now connect without using--tunnel. I think the qrcode/link is not getting the right ip address to shareMesmo problema …
Please tell a workaround to solve it npx expo start --tunnel Starting project at /project/home/vaib215/workspace Starting Metro Bundler CommandError: failed to start tunnel
remote gone away
Same issue today.
Having the exact same issue since this morning
Same here… it is beeing frustrating
Starting Metro Bundler CommandError: TypeError: Cannot read properties of undefined (reading ‘body’)
Is there a solution to this problem? I got the same one and can’t figure out how to xolve it
Starting Metro Bundler warning: Bundler cache is empty, rebuilding (this may take a minute) CommandError: failed to start tunnel
remote gone away
npx expo start --tunnelStarting Metro Bundler CommandError: failed to start tunnelremote gone away
showing the above error since this afternoon
anyone found the solution?
Same here…
Yup, same problem…was working fine in the morning yesterday but wouldn’t work when I attempted again at ~6pm EST.
same probleme …
I have the same problem when using npx expo start --tunnel but when i tried npx expo start then it worked. i’m using expo 48.0.6 and react native 0.71.6
Having the same problem
Same
Same issue here - Yesterday (CET) everything worked. This morning keep getting either
CommandError: TypeError: Cannot read properties of undefined (reading 'body')orCommandError: NgrokClientError: failed to start tunnelThis is blocking because I need this due to a network limitation in our offices to continue developping our app…
Have the same error, cannot start project with tunnel.
npx expo start --clear --tunnelnpx expo start --tunnelHaving the same issue. Sometimes it displays this as well: CommandError: TypeError: Cannot read properties of undefined (reading ‘body’)
Seems independent of expo version, I have tried several different ones.
I rolled back from
48.0.11, but it didn’t work.