Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/app/src/cli/services/dev/extension/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`
}
Expand Down
10 changes: 10 additions & 0 deletions packages/cli-kit/src/public/node/api/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,16 @@ export async function fetchApiVersions(
session: AdminSession,
preferredBehaviour?: RequestModeInput,
): Promise<ApiVersion[]> {
// 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,
Expand Down
Loading