{"record":{"id":"d14ab4177ae3c62c","repo":"quasarframework/quasar","slug":"cancelscaffolding-expects-an-options-object-m","errorCode":null,"errorMessage":"cancelScaffolding() expects an options object: { message?, exit? }","messagePattern":"cancelScaffolding\\(\\) expects an options object: (.+?)","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"create-quasar/lib/utils.js","lineNumber":59,"sourceCode":"}\n\nconst TEMPLATING_FILE_EXTENSIONS = [\n  '',\n  '.json',\n  '.js',\n  '.cjs',\n  '.ts',\n  '.vue',\n  '.md',\n  '.html',\n  '.sass'\n]\n\nfunction cancelScaffolding(opts = {}) {\n  // only the object form is valid; anything else (e.g. a plain string\n  // message) would get silently dropped by the destructuring below\n  if (typeof opts !== 'object' || opts === null) {\n    throw new TypeError(\n      'cancelScaffolding() expects an options object: { message?, exit? }'\n    )\n  }\n\n  const { message = 'Scaffolding cancelled', exit = true } = opts\n\n  cancel(message)\n  if (exit !== false) process.exit(exit === true ? 1 : exit)\n}\n\nfunction exitOnCancel(val) {\n  if (isCancel(val)) cancelScaffolding()\n  return val\n}\n\nasync function promptUser(\n  scope,\n  questions,","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/quasarframework/quasar/blob/4841521b5f635a971eb9e2710e5542efd194691b/create-quasar/lib/utils.js#L41-L77","documentation":"cancelScaffolding() in create-quasar accepts only an options object ({ message?, exit? }). Because the implementation destructures the argument, a non-object value (e.g. a plain string message) would be silently dropped, so the function deliberately throws a TypeError instead. It exists so extension authors calling this internal API do so with the correct shape.","triggerScenarios":"Calling cancelScaffolding('my message') or cancelScaffolding(null/undefined-as-non-object) instead of cancelScaffolding({ message: 'my message' }). Raise paths: createProjectFolder, exitOnCancel and promptUser call it when scaffolding is aborted (Ctrl+C / prompt cancel).","commonSituations":"Wrapping or monkey-patching create-quasar internals in custom scaffolding scripts; upgrading create-quasar where an older string-parameter call signature changed to an options object; custom automation that simulates a user cancel.","solutions":["Change the call to pass an object: cancelScaffolding({ message: 'Cancelled by user' })","If you only want to cancel without exiting, pass { exit: false } explicitly","Pin/align your create-quasar version with the documented API and update custom wrappers that pass a string","Wrap the call in try/catch if you cannot control legacy call sites, and log opts for diagnosis"],"exampleFix":"// before\ncancelScaffolding('Scaffolding cancelled by user')\n// after\ncancelScaffolding({ message: 'Scaffolding cancelled by user', exit: true })","handlingStrategy":"validation","validationCode":"function assertCancelOpts(opts) {\n  if (typeof opts !== 'object' || opts === null) {\n    throw new TypeError('cancelScaffolding() expects { message?, exit? }')\n  }\n}\nassertCancelOpts(myOpts) // call before invoking cancelScaffolding","typeGuard":"function isCancelOptions(v) {\n  return typeof v === 'object' && v !== null\n}","tryCatchPattern":"try {\n  cancelScaffolding({ message, exit: true })\n} catch (err) {\n  if (err instanceof TypeError && err.message.includes('options object')) {\n    cancelScaffolding({ message: 'Scaffolding cancelled' })\n  } else {\n    throw err\n  }\n}","preventionTips":["Always call cancelScaffolding with an object literal, never a bare string","Wrap create-quasar internals once in your own helper with a validated signature","Pin your create-quasar version and check the changelog when upgrading automation scripts","Enable TypeScript or JSDoc types so wrong argument shapes fail at edit time"],"tags":["api-misuse","typeerror","scaffolding"],"backgroundTag":"invalid-argument-type","analyzedSha":"4841521b5f635a971eb9e2710e5542efd194691b","analyzedAt":"2026-08-30T01:13:14.944Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}