cli: Cloudflare is down, and so I cannot run 'npm run dev'

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

Expected behavior

It should have worked.

Actual behavior

Error: Could not start Cloudflare tunnel: max retries reached.

╭─ error ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ │ │ Could not start Cloudflare tunnel: max retries reached. │ │ │ │ What to try: │ │ • Run the command again │ │ • Add the flag --tunnel-url {URL} to use a custom tunnel URL │ │ │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

Verbose output

2023-11-02T21:30:33.829Z: Polling tunnel status for cloudflare (attempt 2): starting
2023-11-02T21:30:34.010Z:
Running system process:
  · Command: C:/Dev/Shopify/premium-consumer-app/node_modules/@shopify/plugin-cloudflare/bin/cloudflared.exe tunnel --url http://localhost:60851 --no-autoupdate
  · Working directory: C:/Dev/Shopify/premium-consumer-app

2023-11-02T21:30:34.029Z: 2023-11-02T21:30:34Z INF Thank you for trying Cloudflare Tunnel. Doing so, without a Cloudflare account, is a quick way to experiment and try it out. However, be aware that 
these account-less Tunnels have no uptime guarantee. If you intend to use Tunnels in production you should use a pre-created named tunnel by following: https://developers.cloudflare.com/cloudflare-one/connections/connect-apps
2023-11-02T21:30:34Z INF Requesting new quick Tunnel on trycloudflare.com...

2023-11-02T21:30:34.337Z: Polling tunnel status for cloudflare (attempt 3): starting
2023-11-02T21:30:34.852Z: Polling tunnel status for cloudflare (attempt 4): starting
2023-11-02T21:30:35.358Z: Polling tunnel status for cloudflare (attempt 5): starting
2023-11-02T21:30:35.868Z: Polling tunnel status for cloudflare (attempt 6): starting
2023-11-02T21:30:36.368Z: Polling tunnel status for cloudflare (attempt 7): starting
2023-11-02T21:30:36.869Z: Polling tunnel status for cloudflare (attempt 8): starting
2023-11-02T21:30:37.381Z: Polling tunnel status for cloudflare (attempt 9): starting
2023-11-02T21:30:37.885Z: Polling tunnel status for cloudflare (attempt 10): starting

Reproduction steps

  1. Create a brand-new app
  2. Run ‘npm run dev’

Operating System

Windows 10

Shopify CLI version (check your project’s package.json if you’re not sure)

3.50.1

Shell

No response

Node version (run node -v if you’re not sure)

No response

What language and version are you using in your application?

No response

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 42 (7 by maintainers)

Most upvoted comments

For those looking for a solution

Run this in one terminal window: ngrok http 8081 And then this in another: npx shopify app dev --tunnel-url=https://YOUR-TUNNEL-HERE.ngrok-free.app:8081/

EDIT: Incorporated @isaacroldan’s shorter version instead of ngrok http http://localhost:8081

It would be nice to have some docs on how to swap out cloudflare for ngrok. Supplying ngrok --tunnel-url to the shopify app dev command doesn’t work. Can anyone shed some light on this and share their setup if you have a working example using ngrok?

Ah, that’s great 😃 Since cloudflare is back up and we already discussed workarounds, i’m going to close this issue. If there are new tunneling problems please open a new one.

I’m running into this issue as well, I’ve tried using ngrok as suggested by some folks but it doesn’t work. I still get connection refused errors

image

Oddly the requests do show up on the ngrok session in the terminal, but nothing happens in the admin side of shopify image

Okay so this worked for me in the end, here are the steps I followed:

  1. First setup ngrok: https://ngrok.com/product/secure-tunnels
  2. Create an ngrok tunnel on port 8080: ngrok http 8080.
  3. Copy the forwarding address. This should be something like: https://f355-2607-fea8-bb5c-8700-7972-d2b5-3f2b-94ab.ngrok-free.app
  4. In a separate terminal run yarn shopify app dev --tunnel-url=TUNNEL_URL:8080 replacing TUNNEL_URL for the address you copied in step 3.

This is from @byrichardpowell, I followed this exactly and it worked like a charm. ✨

shopify app dev --tunnel-url=https://yourul.ngrok-free.app:8081 please change “-” to “=” after --tunnel-url

this worked, thank you!