{"record":{"id":"93ed14d9ed195e16","repo":"quasarframework/quasar","slug":"assetrelativepath-already-exists","errorCode":null,"errorMessage":"${assetRelativePath} already exists.","messagePattern":"(.+?) already exists\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"app-vite/lib/cmd/new.js","lineNumber":117,"sourceCode":"]\nif (!validAssetTypes.includes(rawType)) {\n  showError(\n    `Invalid asset type: ${rawType} (valid values: ${validAssetTypes.join('|')})`\n  )\n}\n\n/** @type {'page'|'layout'|'component'|'store'|'boot'|'ssrmiddleware'} */\nconst type = typeAliasMap[rawType] || rawType\n\nif (!['js', 'ts'].includes(format)) {\n  showError(`Invalid asset format: ${format} (valid values: js|ts)`)\n}\n\nfunction createFile({ targetFile, ext, reference }) {\n  const assetRelativePath = relative(appPaths.appDir, targetFile)\n\n  if (fs.existsSync(targetFile)) {\n    warn(`${assetRelativePath} already exists.`, 'SKIPPED')\n    console.log()\n    return\n  }\n\n  fse.ensureDir(dirname(targetFile))\n  const templatePath = join('templates/app', format, `${type}.${ext}`)\n\n  fse.copy(appPaths.resolve.cli(templatePath), targetFile, err => {\n    if (err) {\n      console.warn(err)\n      warn(`Could not generate ${assetRelativePath}.`, 'FAIL')\n      return\n    }\n\n    log(`Generated ${type}: ${assetRelativePath}`)\n    if (reference) {\n      log(`Make sure to reference it in ${reference}`)\n    }","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/quasarframework/quasar/blob/4841521b5f635a971eb9e2710e5542efd194691b/app-vite/lib/cmd/new.js#L99-L135","documentation":"`quasar new <type> <name>` skips generation when the target file already exists, to never overwrite user code. It prints the relative path with a SKIPPED label and continues with the remaining names. This is a non-fatal notice, not an error.","triggerScenarios":"Running `quasar new p MyPage` when src/pages/MyPage.vue (or the exact target path including extension) already exists (new.js createFile).","commonSituations":"Re-running a scaffolding script after a partial failure; naming collisions with existing components/pages; re-running the same `quasar new` command with multiple names.","solutions":["Nothing to fix — the existing file was intentionally preserved; edit it manually if changes are needed.","Delete or rename the existing file if you want the template regenerated.","Use a different name for the new asset."],"exampleFix":"// before\nquasar new p Login   # src/pages/Login.vue exists -> skipped\n// after\nquasar new p Login2  # or delete/merge the existing src/pages/Login.vue","handlingStrategy":"validation","validationCode":"const target = 'src/pages/MyPage.vue';\nif (fs.existsSync(target)) console.log('skip: already exists');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check for the target file before scaffolding in scripts.","Use unique names for generated assets.","Remember the CLI never overwrites — edit existing files manually."],"tags":["cli","scaffolding","file-exists"],"backgroundTag":"file-already-exists","analyzedSha":"4841521b5f635a971eb9e2710e5542efd194691b","analyzedAt":"2026-08-30T01:13:14.944Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}