diff --git a/packages/app/src/cli/services/dev/extension/utilities.ts b/packages/app/src/cli/services/dev/extension/utilities.ts index 6288f770faf..a2b1366a7ed 100644 --- a/packages/app/src/cli/services/dev/extension/utilities.ts +++ b/packages/app/src/cli/services/dev/extension/utilities.ts @@ -11,6 +11,14 @@ export async function buildCartURLIfNeeded(extensions: ExtensionInstance[], stor const hasUIExtension = extensions.filter((extension) => extension.shouldFetchCartUrl()).length > 0 if (!hasUIExtension) return undefined if (checkoutCartUrl) return checkoutCartUrl + + // In local development, skip fetching product variant if the flag is set + // This allows the CLI to work when local services don't have proper auth set up + if (process.env.SHOPIFY_SERVICE_ENV === 'local' && process.env.SHOPIFY_CLI_SKIP_PRODUCT_FETCH === '1') { + // Return a mock variant ID for local development + return '/cart/123456789:1' + } + const variantId = await fetchProductVariant(store) return `/cart/${variantId}:1` } diff --git a/packages/cli-kit/src/public/node/api/admin.ts b/packages/cli-kit/src/public/node/api/admin.ts index 107d91686fa..9a55b7b99c9 100644 --- a/packages/cli-kit/src/public/node/api/admin.ts +++ b/packages/cli-kit/src/public/node/api/admin.ts @@ -161,6 +161,16 @@ export async function fetchApiVersions( session: AdminSession, preferredBehaviour?: RequestModeInput, ): Promise { + // In local development, skip the API version check and return a hardcoded list + // This allows the CLI to work when local services don't have proper auth set up + if (serviceEnvironment() === 'local' && process.env.SHOPIFY_CLI_SKIP_VERSION_CHECK === '1') { + return [ + {handle: '2024-10', supported: true}, + {handle: '2025-01', supported: true}, + {handle: 'unstable', supported: true}, + ] + } + try { const response = await adminRequestDoc({ query: PublicApiVersions,