Skip to content

Fix admin URL for local core: add 'admin' to NON_SHOP_PREFIXES#7137

Merged
craigmichaelmartin merged 1 commit intomainfrom
fix/admin-local-url-prefix
Apr 2, 2026
Merged

Fix admin URL for local core: add 'admin' to NON_SHOP_PREFIXES#7137
craigmichaelmartin merged 1 commit intomainfrom
fix/admin-local-url-prefix

Conversation

@craigmichaelmartin
Copy link
Copy Markdown
Contributor

When running against a local core, pressing 'p' to preview in the Shopify CLI incorrectly opens admin.my.shop.dev instead of admin.shop.dev. This happens because 'admin' is not in the NON_SHOP_PREFIXES list in the 2024 dev server, causing the host function to treat it as a shop name and route it through the {prefix}.my.shop.dev pattern instead of {prefix}.shop.dev.

@craigmichaelmartin craigmichaelmartin requested a review from a team as a code owner March 31, 2026 20:29
@github-actions
Copy link
Copy Markdown
Contributor

We detected some changes at packages/*/src and there are no updates in the .changeset.
If the changes are user-facing, run pnpm changeset add to track your changes and include them in the next release CHANGELOG.

Caution

DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release.

When running against a local core, pressing 'p' to preview in the
Shopify CLI incorrectly opens admin.my.shop.dev instead of
admin.shop.dev. This happens because 'admin' is not in the
NON_SHOP_PREFIXES list in the 2024 dev server, causing the host
function to treat it as a shop name and route it through the
{prefix}.my.shop.dev pattern instead of {prefix}.shop.dev.

Co-authored-by: Paulo Margarido <paulo.margarido@shopify.com>
@shopify-river shopify-river bot force-pushed the fix/admin-local-url-prefix branch from 5cd1758 to 4deaee1 Compare March 31, 2026 20:35
import type {HostOptions} from './types.js'

const NON_SHOP_PREFIXES = ['app', 'dev', 'shopify']
const NON_SHOP_PREFIXES = ['admin', 'app', 'dev', 'shopify']
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Wait, just noticed this file is in node/vendor 🤔

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.

Yeah, the fix makes sense (didn't tophat), but we need to check if we need to update this vendored file

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, already merged.

@craigmichaelmartin
Copy link
Copy Markdown
Contributor Author

This file is vendored from Shopify/dev_server (node-package/src/dev-server-2024.ts), which has the same bug — 'admin' is missing from NON_SHOP_PREFIXES there too. If we fix it only here, the next "Update DevServer vendor" will overwrite the fix.

The right approach is to fix it upstream in Shopify/dev_server first, then re-vendor. I'll open a PR there.

Copy link
Copy Markdown
Contributor

@paulomarg paulomarg left a comment

Choose a reason for hiding this comment

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

LGTM

@craigmichaelmartin craigmichaelmartin added this pull request to the merge queue Apr 2, 2026
Merged via the queue into main with commit 15e2bcd Apr 2, 2026
26 checks passed
@craigmichaelmartin craigmichaelmartin deleted the fix/admin-local-url-prefix branch April 2, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants