-
Notifications
You must be signed in to change notification settings - Fork 223
Description
I have wasted several days on this issue. I haven't seen a single sentence in Shopify documentation mentioning this.
I use so-called cloudflare locally-managed tunnels extensively.
https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/do-more-with-tunnels/local-management/create-local-tunnel/
It allows me to have infinite permanent tunnels.
So I can have, for example: my-custom-shopify-app-with-function.example.com
And then I can, for example, have a webhook registered to that domain. I don't need to recreate/update webhooks every time I start a server.
I also have:
[build]
automatically_update_urls_on_dev = false...because I didn't need it. Or at least I thought I don't need it.
However, this causes an issue deep within Shopify CLI, where Shopify CLI somewhere relies on cloudflare free tunnel ("TryCloudflare" aka "Quick Tunnel"). However, cloudflare quick tunnels don't work well with cloudflare local tunnels.
This wasn't an issue for me. Until I tried to run Shopify function locally.
TryCloudflare quick tunnels are currently not supported if a
config.yamlconfiguration file is present in the.cloudflareddirectory. It may be necessary to rename that file temporarily to use the feature.
I've spent several days trying to debug this Shopify CLI issue. Yes, it's a Cloudflare issue, but it's also Shopify CLI issue.
The only way to "fix" this is by doing:
mv ~/.cloudflared/config.yml ~/.cloudflared/config.yml2And setting:
[build]
automatically_update_urls_on_dev = trueThe better fix would be if Shopify CLI would try to be less smart and, instead of hiding many of the underlying settings/config, it would expose it, with sensible defaults.
Some other examples where Shopify CLI tries to be too smart and ruins the experience (potential making changes to the store(s) for the wrong client/merchant):
- Shopify CLI stores and hides away the current store
- Shopify CLI stores and hides away the current config app/extension/etc. TOML (
shopify app devshould always assume the default config, for example,shopify.app.toml, and allow user to override this with--config- it does this, but because it's reading it from its internal storage, sometimes this is still broken even when--configis specified, without--configit doesn't use default, it uses "remembered" file. This is wrong, IMO.)
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?
Extension, Function, App
Expected behavior
shopify app dev works with Preview and local function testing
Actual behavior
The local function testing fails silently.
Verbose output
Verbose output
There is no output, when you start local server with shopify app dev, and have, for example delivery function, the delivery function never reaches your local server.
Reproduction steps
- You have to have a cloudflare account and a domain in cloudflare
- Use cloudflare to create a subdomain tunnel for your domain
- Run
shopify app dev - Go to checkout to trigger Shopify Function call
Operating System
macOS 15.4.1
Shopify CLI version (shopify --version)
3.77.1
Shell
zsh
Node version (run node -v if you're not sure)
v22.12.0
What language and version are you using in your application?
ruby 3.4.3 (2025-04-14 revision d0b7e5b6a0) +PRISM [arm64-darwin24]