diff --git a/packages/create-sitecore-jss/src/initializers/nextjs-sxa/index.ts b/packages/create-sitecore-jss/src/initializers/nextjs-sxa/index.ts index d24687c824..7a7d6cad64 100644 --- a/packages/create-sitecore-jss/src/initializers/nextjs-sxa/index.ts +++ b/packages/create-sitecore-jss/src/initializers/nextjs-sxa/index.ts @@ -5,6 +5,7 @@ import { transform, DEFAULT_APPNAME, ClientAppArgs, + incompatibleAddonsMsg, } from '../../common'; export default class NextjsSxaInitializer implements Initializer { @@ -28,6 +29,13 @@ export default class NextjsSxaInitializer implements Initializer { await transform(templatePath, mergedArgs); + if ( + args.templates.includes('nextjs-styleguide') || + pkg.config?.templates?.includes('nextjs-styleguide') + ) { + console.log(incompatibleAddonsMsg('nextjs-sxa', 'nextjs-styleguide')); + } + const response = { // TODO: next steps nextSteps: [], diff --git a/packages/create-sitecore-jss/src/initializers/nextjs/prompts.ts b/packages/create-sitecore-jss/src/initializers/nextjs/prompts.ts index d44236f4c4..e501ed1d91 100644 --- a/packages/create-sitecore-jss/src/initializers/nextjs/prompts.ts +++ b/packages/create-sitecore-jss/src/initializers/nextjs/prompts.ts @@ -53,5 +53,14 @@ export class NextjsCheckbox extends CheckboxPrompt { isValid: incompatibleAddonsMsg('nextjs-styleguide-tracking', 'nextjs-personalize'), }); } + + const isSxaSelected = isSelected('nextjs-sxa'); + const isStyleguideSelected = isSelected('nextjs-styleguide'); + + if (isSxaSelected && isStyleguideSelected) { + this.onError({ + isValid: incompatibleAddonsMsg('nextjs-sxa', 'nextjs-styleguide'), + }); + } } }