diff --git a/packages/app/src/cli/models/extensions/specification.ts b/packages/app/src/cli/models/extensions/specification.ts index 019b6b8cdc2..9b6e02871f1 100644 --- a/packages/app/src/cli/models/extensions/specification.ts +++ b/packages/app/src/cli/models/extensions/specification.ts @@ -233,6 +233,7 @@ export function createConfigExtensionSpecification Promise + preDeployValidation?: (extension: ExtensionInstance) => Promise }): ExtensionSpecification { const appModuleFeatures = spec.appModuleFeatures ?? (() => []) return createExtensionSpecification({ @@ -246,6 +247,7 @@ export function createConfigExtensionSpecification { + const scopes = extension.configuration.access_scopes.scopes + if (scopes !== undefined) { + const requiredScopes: string[] = scopes.split(',') + const formattedRequiredScopes = requiredScopes.map((s) => `"${s}"`).join(', ') + throw new AbortError( + `The 'scopes' configuration is deprecated and no longer supported. It has been replaced by 'required_scopes'`, + `In your 'shopify.app.toml' file, replace 'scopes' with 'required_scopes'. + + - scopes: "${scopes}" + + required_scopes: [${formattedRequiredScopes}] + `, + ) + } + return Promise.resolve() + }, }) export default appAccessSpec