{"record":{"id":"2e837c57da544b4a","repo":"shadcn-ui/ui","slug":"migration-cancelled","errorCode":null,"errorMessage":"Migration cancelled.","messagePattern":"Migration cancelled\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"packages/shadcn/src/migrations/cn/index.ts","lineNumber":69,"sourceCode":"\n  if (!changedFiles.length) {\n    logger.info(\"No supported clsx, tailwind-merge or cnfast usage found.\")\n    printUnsupportedIssues(unsupported, options.cwd)\n    return\n  }\n\n  assertTailwindCompatibility(options.cwd, migratedPackages)\n\n  if (!options.yes) {\n    const { confirm } = await prompts({\n      type: \"confirm\",\n      name: \"confirm\",\n      initial: true,\n      message: `We will migrate ${highlighter.info(\n        changedFiles.length\n      )} file(s) to ${highlighter.info(\"cn\")}${\n        unsupported.length\n          ? ` and leave ${highlighter.warn(\n              unsupported.length\n            )} item(s) for manual review`\n          : \"\"\n      }. Continue?`,\n    })\n\n    if (!confirm) {\n      logger.info(\"Migration cancelled.\")\n      return\n    }\n  }\n\n  const migrationSpinner = spinner(\"Migrating to cn...\")?.start()\n  await installDependencies(options.cwd, [\"cn\"])\n\n  for (const { file, result } of changedFiles) {\n    await fs.writeFile(file, result.content)\n  }","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/shadcn-ui/ui/blob/5c7072da672b0048bc6771e3204063a2537df91a/packages/shadcn/src/migrations/cn/index.ts#L51-L87","documentation":"Before writing any files, migrateCn shows an interactive confirmation prompt summarizing how many files will change and how many items need manual review. If the user answers no (confirm is falsy), the CLI logs `Migration cancelled.` and returns normally — no error is thrown and no files or dependencies are modified.","triggerScenarios":"Running migrateCn without `yes: true` and pressing n/Escape at the 'Continue?' confirm prompt, or the prompts library returning a falsy confirm (e.g. non-TTY cancellation).","commonSituations":"Reviewing the diff counts and deciding to back out; aborting after seeing a large number of manual-review items; CI running the command non-interactively where prompts aborts and confirm is undefined.","solutions":["Rerun the migration and answer yes at the prompt to proceed.","Use the `--yes` flag (yes: true) to skip the interactive confirmation in scripts/CI.","If it cancelled unexpectedly in CI, that is the non-TTY prompt aborting — always pass --yes in headless environments."],"exampleFix":"// before (CI, hangs/cancels at prompt)\nawait migrateCn({ cwd: process.cwd() })\n// after\nawait migrateCn({ cwd: process.cwd(), yes: true })","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"const result = await migrateCn({ cwd: process.cwd(), yes: isCI })\nif (!result) logger.info('Migration was cancelled or produced no changes')","preventionTips":["Pass yes: true / --yes in CI or non-interactive shells.","Review the proposed change counts before confirming interactively.","Run on a clean git branch so cancellation has no cost."],"tags":["user-abort","interactive-prompt","cli"],"backgroundTag":"user-abort","analyzedSha":"5c7072da672b0048bc6771e3204063a2537df91a","analyzedAt":"2026-09-07T00:08:47.579Z","contentChangedAt":"2026-09-07T00:08:47.579Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}