cli: [Bug]: Ngrok "Failed to start the tunnel"
Please confirm that you have:
- Searched existing issues to see if your issue is a duplicate. (If you’ve found a duplicate issue, feel free to add additional information in a comment on it.)
- Reproduced the issue in the latest CLI version.
In which of these areas are you experiencing a problem?
App, Extension, Theme
Expected behavior
Be able to start ngrok tunnel after running through steps to create a Node.js app
Actual behavior
Throwing an error on yarn dev and erroring out.
Stack trace
/Users/robert/Desktop/usrx-custom-app/us-rx/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
throw ex;
^
Error: failed to start the tunnel
at connectRetry (/Users/robert/Desktop/usrx-custom-app/us-rx/node_modules/@shopify/ngrok/index.js:45:11)
at async /Users/robert/Desktop/usrx-custom-app/us-rx/node_modules/@shopify/ngrok/index.js:30:17
Node.js v18.9.1
error Command failed with exit code 7.
Reproduction steps
- Complete setup instructions per terminal
- Run
yarn dev
Operating System
Mac OS Monterey
Shopify CLI version (check your project’s package.json if you’re not sure)
3.37.0
Shell
bash
Node version (run node -v if you’re not sure)
v18.9.1
What language and version are you using in your application?
Node v18.9.1
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 27 (8 by maintainers)
I went to
/project/node_modules/@shopify/ngrok/src/client.jsand went into the function that starts the tunnel and realized the package was throwing an error if ngrok didn’t connect in first 10 tries
so I changed the retryCount to 20 and it worked
Hope it helps in debugging
My temporary solution (replace
8898with anything you want) (inspired by @hmthang96 comment):$ ngrok http 8898→ copy https url, for examplehttps://2156-37-122-170-60.ngrok.io$ pnpm run dev --tunnel-url "https://2156-37-122-170-60.ngrok.io:8988" --theme-app-extension-port=8988@Tomtom1410 @joeainsworth , this is a different issue, related with cloudflare not ngrok. Could you open a new issue so that we can track it properly? Please include as much info as possible: OS, terminal, node version, and if possible, run the same command with
--verboseand attach the output.Hi there, I init a shopify app and run it, but i have an error, so i can’t run my project, I use latest CLI 3.46.0. Can you have me resolve it? I also tried with cloudflered, but it still doesn’t work This is my error:
Hi @usrx-rob have you tried to kill any potentially running ngrok process wth
killall ngrokand runningdevagain?