Skip to content

Fix custom tunnel URL precedence in Codespaces app dev#7488

Open
afurm wants to merge 1 commit intoShopify:mainfrom
afurm:af/fix-codespaces-custom-tunnel
Open

Fix custom tunnel URL precedence in Codespaces app dev#7488
afurm wants to merge 1 commit intoShopify:mainfrom
afurm:af/fix-codespaces-custom-tunnel

Conversation

@afurm
Copy link
Copy Markdown
Contributor

@afurm afurm commented May 7, 2026

WHY are these changes introduced?

Related to #6235

When shopify app dev runs inside GitHub Codespaces, generateFrontendURL currently detects the Codespaces environment before checking --tunnel-url. That means an explicit custom tunnel URL is ignored and the CLI always builds a Codespaces forwarding URL instead.

This blocks developers who need to bring their own tunnel in Codespaces, for example to avoid embedded app preview failures caused by GitHub/Codespaces framing or cookie behavior.

WHAT is this pull request doing?

  • Gives --tunnel-url precedence before Codespaces and Gitpod auto URL detection.
  • Preserves the existing Codespaces and Gitpod URL behavior when no custom tunnel URL is provided.
  • Adds a regression test proving custom tunnel URLs win in a Codespaces environment.
  • Adds a patch changeset for @shopify/app.

How to test your changes?

Automated checks run locally:

pnpm vitest run packages/app/src/cli/services/dev/urls.test.ts
pnpm nx run app:type-check
pnpm nx run app:lint
git diff --check

Manual behavior to verify:

shopify app dev --tunnel-url="https://my-tunnel-provider.io:4242"

In a Codespaces environment, the app dev frontend URL should use https://my-tunnel-provider.io with port 4242, instead of replacing it with the Codespaces forwarding URL.

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • The change is user-facing — I've identified the correct bump type (patch for bug fixes · minor for new features · major for breaking changes) and added a changeset with pnpm changeset add

@afurm afurm marked this pull request as ready for review May 7, 2026 13:25
@afurm afurm requested review from a team as code owners May 7, 2026 13:25
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.

1 participant