quasarframework/quasar · warning
extendJsonFile() - " " doesn't conform to JSON format: this…
Error message
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... What it means
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.
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().
Example fix
// before: tsconfig.json with comments
{
// compiler options
"compilerOptions": { "strict": true }
}
// after: strict JSON parseable by extendJsonFile
{
"compilerOptions": { "strict": true }
} Defensive patterns
Strategy: validation
Validate before calling
const fs = require('fs');
try { JSON.parse(fs.readFileSync(targetFile, 'utf8')); }
catch { /* file is JSONC/JSON5 or malformed — merge manually or strip comments first */ } Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: JSON parse error: "Unexpected token" / "not valid JSON" / "failed to parse" — what JSON parsers are really complaining about — this error's family across 45 libraries.
Related errors
- extendJsonFile() - The extension tried to apply these…
- App Extension has no command called
- App Extension has no commands registered
- extendPackageJson() - cannot locate
- extendPackageJson() - " " is a folder instead of file…
AI-assisted analysis of quasarframework/quasar@4841521b5f (2026-08-30).
Data as JSON: /api/errors/11651ba3f8ce433a.
Report an issue: GitHub.
Appendix: source
Thrown at app-vite/lib/app-extension/api-classes/InstallAPI.js:228
// TODO: use parseJSONC/stringifyJSONC from confbox
try {
const existingData = fs.existsSync(filePath)
? parseJSON(fs.readFileSync(filePath, 'utf8'))
: {}
const data = merge({}, existingData, newData)
fs.ensureDirSync(path.dirname(filePath))
fs.writeFileSync(
filePath,
// if file exists, preserve indentation, otherwise use 2 spaces
stringifyJSON(data, {
indent: Object.keys(existingData).length !== 0 ? void 0 : 2
}),
'utf8'
)
} catch {
warn()
this.logger.warn(
`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...`
)
this.logger.warn(
`extendJsonFile() - The extension tried to apply these updates to "${filePath}" file: ${JSON.stringify(newData)}`
)
warn()
}
}
}
/**
* Render a folder from extension templates into devland.
* Needs a path (to a folder) relative to the path of the file where render() is called
*
* @param {string} templatePath (relative path to folder to render in app)
* @param {object} scope (optional; rendering scope variables)
*/
render(templatePath, scope) {View on GitHub (pinned to 4841521b5f)