Skip to content

Fix Shopify launches on Shopify CLI 4.x - #154

Merged
alexleventer merged 3 commits into
fly-apps:mainfrom
alexleventer:shopify-cli-4-deploy
Oct 21, 2026
Merged

alexleventer merged 3 commits into
fly-apps:mainfrom
alexleventer:shopify-cli-4-deploy

Conversation

@alexleventer

@alexleventer alexleventer commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

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 --force from shopify app deploy. flyShopifyConfig still runs shopify app deploy --force, which exits with Nonexistent flag: --force. The execSync isn't caught, so the generator exits 1 and fly launch fails with failed 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 Dockerfile is 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-updates first appeared in Shopify CLI 3.90 (3.87 has only --force), so the flag is picked from shopify app deploy --help and older 3.x CLIs still get --force.
  • Catch a failed 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.
  • Pass --config to shopify app env show, matching the command the log line already prints.

Testing

New fly: shopify tests in test/test.js stub flyctl and shopify on 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 on main.

Manual checks:
Against the current Shopify/shopify-app-template-react-router, with client_id/application_url filled in, fly.toml present, and a stub flyctl:

  • No Shopify CLI: before, exit 1 at fly.js:395. After, warns and exits 0.
  • Stub shopify that rejects --force like CLI 4.x: after, app deploy --allow-updates --config shopify.app.toml runs and exits 0. shopify.app.toml is rewritten to <app>.fly.dev.
  • Confirmed --allow-updates is valid on @shopify/cli@4.9.2 and --force is rejected.
  • eslint clean. npm test: 126 passing, 3 failing (bun base/cache-bun, svelte-bun), same 3 fail on main.

🤖 Generated with Claude Code

alexleventer and others added 3 commits October 9, 2026 08:30
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 kylemclaren left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, tested and verified the fix.

@alexleventer
alexleventer merged commit ca520e8 into fly-apps:main Oct 21, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fly launch for Shopify apps fails: shopify app deploy --force — --force removed in Shopify CLI 4.x

2 participants