{"record":{"id":"0dcea2cc7b817e7c","repo":"ajaxorg/ace","slug":"unknown-config-key","errorCode":null,"errorMessage":"Unknown config key: ","messagePattern":"Unknown config key: ","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/config.js","lineNumber":31,"sourceCode":"    workerPath: null,\n    modePath: null,\n    themePath: null,\n    basePath: \"\",\n    suffix: \".js\",\n    $moduleUrls: {},\n    loadWorkerFromBlob: true,\n    sharedPopups: false,\n    useStrictCSP: null\n};\n\n/**\n * @template {keyof import(\"../ace-internal\").Ace.ConfigOptions} K\n * @param {K} key - The key of the config option to retrieve.\n * @returns {import(\"../ace-internal\").Ace.ConfigOptions[K]} - The value of the config option.\n */\nexports.get = function(key) {\n    if (!options.hasOwnProperty(key))\n        throw new Error(\"Unknown config key: \" + key);\n    return options[key];\n};\n\n/**\n * @template {keyof import(\"../ace-internal\").Ace.ConfigOptions} K\n * @param {K} key\n * @param {import(\"../ace-internal\").Ace.ConfigOptions[K]} value\n */\nexports.set = function(key, value) {\n    if (options.hasOwnProperty(key))\n        options[key] = value;\n    else if (this.setDefaultValue(\"\", key, value) == false)\n        throw new Error(\"Unknown config key: \" + key);\n    if (key == \"useStrictCSP\")\n        dom.useStrictCSP(value);\n};\n/**\n * @return {import(\"../ace-internal\").Ace.ConfigOptions}","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/ajaxorg/ace/blob/2c1eddc392eb92cf222a4478f1893d2b2c354fb0/src/config.js#L13-L49","documentation":"config.get(key) only accepts keys that exist in the options registry (the Ace.ConfigOptions type). Unknown keys are rejected rather than returning undefined, so typos or renamed options fail fast.","triggerScenarios":"Calling ace.config.get('theme') (misspelled or legacy option name), or getting an option introduced in a newer/older Ace version than the one loaded.","commonSituations":"Upgrading Ace and an option was renamed; copying option names from third-party docs; camelCase vs different casing mistakes (e.g. 'font_size' vs 'fontSize').","solutions":["Check the option name against Ace's documented ConfigOptions list","Use the correct casing/spelling (Ace options are camelCase, e.g. fontSize, useWorker)","Verify loaded Ace version supports the option","Wrap with a hasOwnProperty check on ace.config.getDefaults() keys before calling get"],"exampleFix":"// before\nconst size = ace.config.get('font_size');\n// after\nconst size = ace.config.get('fontSize');","handlingStrategy":"validation","validationCode":"var validKeys = Object.keys(ace.config.getDefaults());\nif (!validKeys.includes('fontSize')) throw new Error('unsupported option');\nvar v = ace.config.get('fontSize');","typeGuard":"function isConfigKey(k) { return typeof k === 'string' && Object.prototype.hasOwnProperty.call(ace.config.getDefaults(), k); }","tryCatchPattern":"try { return ace.config.get(key); } catch (e) { if (/Unknown config key/.test(e.message)) return undefined; throw e; }","preventionTips":["Only use keys from ace.config.getDefaults()","Use camelCase option names","Pin and check the Ace version when relying on newer options"],"tags":["config","validation"],"backgroundTag":"unknown-config-key","analyzedSha":"2c1eddc392eb92cf222a4478f1893d2b2c354fb0","analyzedAt":"2026-08-30T00:39:52.222Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}