{"record":{"id":"11651ba3f8ce433a","repo":"quasarframework/quasar","slug":"extendjsonfile-filepath-doesn-t-conform-t","errorCode":null,"errorMessage":"extendJsonFile() - \"${filePath}\" doesn't conform to JSON format: this could happen if you are trying to update flavoured JSON files (eg. JSON with Comments or JSON5). Skipping...","messagePattern":"extendJsonFile\\(\\) - \"(.+?)\" doesn't conform to JSON format: this could happen if you are trying to update flavoured JSON files \\(eg\\. JSON with Comments or JSON5\\)\\. Skipping\\.\\.\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"app-vite/lib/app-extension/api-classes/InstallAPI.js","lineNumber":228,"sourceCode":"      // TODO: use parseJSONC/stringifyJSONC from confbox\n      try {\n        const existingData = fs.existsSync(filePath)\n          ? parseJSON(fs.readFileSync(filePath, 'utf8'))\n          : {}\n        const data = merge({}, existingData, newData)\n\n        fs.ensureDirSync(path.dirname(filePath))\n        fs.writeFileSync(\n          filePath,\n          // if file exists, preserve indentation, otherwise use 2 spaces\n          stringifyJSON(data, {\n            indent: Object.keys(existingData).length !== 0 ? void 0 : 2\n          }),\n          'utf8'\n        )\n      } catch {\n        warn()\n        this.logger.warn(\n          `extendJsonFile() - \"${filePath}\" doesn't conform to JSON format: this could happen if you are trying to update flavoured JSON files (eg. JSON with Comments or JSON5). Skipping...`\n        )\n        this.logger.warn(\n          `extendJsonFile() - The extension tried to apply these updates to \"${filePath}\" file: ${JSON.stringify(newData)}`\n        )\n        warn()\n      }\n    }\n  }\n\n  /**\n   * Render a folder from extension templates into devland.\n   * Needs a path (to a folder) relative to the path of the file where render() is called\n   *\n   * @param {string} templatePath (relative path to folder to render in app)\n   * @param {object} scope (optional; rendering scope variables)\n   */\n  render(templatePath, scope) {","sourceCodeStart":210,"sourceCodeEnd":246,"githubUrl":"https://github.com/quasarframework/quasar/blob/4841521b5f635a971eb9e2710e5542efd194691b/app-vite/lib/app-extension/api-classes/InstallAPI.js#L210-L246","documentation":"Quasar App Extension install scripts use api.extendJsonFile(file, newData) to deep-merge props into an app JSON file. This warning means parsing the existing file with Node's native JSON.parse failed, so nothing was written. It fires for JSON flavours (JSONC/JSON5, e.g. tsconfig.json with comments or VSCode settings.json) or genuinely malformed JSON, and the update is skipped rather than corrupting the file.","triggerScenarios":"Calling api.extendJsonFile() from an extension's install script where the target file exists but its contents fail JSON.parse — e.g. the file contains // or /* */ comments, trailing commas, single quotes, or is truncated/invalid JSON.","commonSituations":"Extending tsconfig.json (typically has comments), .vscode/settings.json, or a hand-edited package.json with a syntax error; running 'quasar ext' install on a project whose flavoured JSON files can't be parsed by native JSON tooling.","solutions":["Remove all comments/trailing commas from the target JSON file (make it strict JSON) and re-run the extension install.","Manually apply the merged props listed in the follow-up warning ('The extension tried to apply these updates') to the file by hand.","Validate the file with JSON.parse/JSONLint; if it's truly malformed, fix the syntax error first.","If the file must stay JSONC/JSON5, keep the skip and manage that file outside of extendJsonFile()."],"exampleFix":"// before: tsconfig.json with comments\n{\n  // compiler options\n  \"compilerOptions\": { \"strict\": true }\n}\n// after: strict JSON parseable by extendJsonFile\n{\n  \"compilerOptions\": { \"strict\": true }\n}","handlingStrategy":"validation","validationCode":"const fs = require('fs');\ntry { JSON.parse(fs.readFileSync(targetFile, 'utf8')); }\ncatch { /* file is JSONC/JSON5 or malformed — merge manually or strip comments first */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep extension-targeted JSON files (package.json, quasar.config-related JSON) free of comments and trailing commas.","Keep tsconfig.json-like files as strict JSON or manage them outside extendJsonFile().","Lint JSON files in CI to catch syntax errors early."],"tags":["json","jsonc","app-extension","install-script","parse-error"],"backgroundTag":"json-parse-failure","analyzedSha":"4841521b5f635a971eb9e2710e5542efd194691b","analyzedAt":"2026-08-30T01:13:14.944Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}