Repository navigation
Fix Shopify launches on Shopify CLI 4.x - #154
Merged
Merged
Conversation
Shopify CLI 4.0 removed `--force` from `shopify app deploy`, so `fly launch` on a Shopify app fails with "Nonexistent flag: --force" and Dockerfile generation exits 1. Use `--allow-updates`, Shopify's replacement for non-interactive runs. Also catch a failed `shopify app deploy` (for example, CLI not installed) and warn instead of aborting the launch, and pass `--config` to `shopify app env show` as the log line already says. Fixes fly-apps#151. Supersedes fly-apps#153. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
--allow-updates first appeared in Shopify CLI 3.90 (3.87 has only --force), so check `shopify app deploy --help` and use --force when --allow-updates isn't listed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kylemclaren
approved these changes
Oct 21, 2026
kylemclaren
left a comment
Contributor
There was a problem hiding this comment.
LGTM, tested and verified the fix.
This was referenced Oct 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #151. Supersedes #153 (thanks @chiliec — same flag change, plus error handling). Also reported as superfly/flyctl#4944.
Problem
Shopify CLI 4.0 (May 2026) removed
--forcefromshopify app deploy.flyShopifyConfigstill runsshopify app deploy --force, which exits withNonexistent flag: --force. TheexecSyncisn't caught, so the generator exits 1 andfly launchfails withfailed to generate Dockerfile: exit status 1.In flyctl launch telemetry since Sep 6, 82% of Shopify launches failed (212/260), vs 9% for NodeJS.
failed to generate Dockerfileis the top error, across 78 orgs.Changes
shopify app deploy --force→--allow-updates(Shopify's documented replacement for non-interactive runs; adds and updates config, never deletes).--allow-updatesfirst appeared in Shopify CLI 3.90 (3.87 has only--force), so the flag is picked fromshopify app deploy --helpand older 3.x CLIs still get--force.shopify app deploy, for example when the Shopify CLI isn't on PATH. Print a warning with the command to run, rather than aborting the whole launch. Before this, a missing CLI also exited 1.--configtoshopify app env show, matching the command the log line already prints.Testing
New
fly: shopifytests intest/test.jsstubflyctlandshopifyon PATH and cover: CLI 4.x (--allow-updates, URLs rewritten), CLI before 3.90 (--force), deploy failing, and CLI not installed. The CLI 4.x and failure tests fail onmain.Manual checks:
Against the current
Shopify/shopify-app-template-react-router, withclient_id/application_urlfilled in,fly.tomlpresent, and a stubflyctl:fly.js:395. After, warns and exits 0.shopifythat rejects--forcelike CLI 4.x: after,app deploy --allow-updates --config shopify.app.tomlruns and exits 0.shopify.app.tomlis rewritten to<app>.fly.dev.--allow-updatesis valid on@shopify/cli@4.9.2and--forceis rejected.eslintclean.npm test: 126 passing, 3 failing (bun base/cache-bun, svelte-bun), same 3 fail onmain.🤖 Generated with Claude Code