{"record":{"id":"9e1d2ceca5e60cfa","repo":"MagicMirrorOrg/MagicMirror","slug":"module-index-mod-module-uses-unknown-pos","errorCode":null,"errorMessage":"Module ${index} (\"${mod.module}\") uses unknown position: \"${mod.position}\"","messagePattern":"Module (.+?) \\(\"(.+?)\"\\) uses unknown position: \"(.+?)\"","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"js/utils.js","lineNumber":276,"sourceCode":"\t\t\tLog.error(`This module configuration contains errors:\\n${JSON.stringify(mod, null, 2)}\\nmodule entry must be an object`);\n\t\t\tthrow new ConfigError(\"\");\n\t\t}\n\n\t\t// `module` (the module name) is required and must be a string\n\t\tif (typeof mod.module !== \"string\") {\n\t\t\tLog.error(`This module configuration contains errors:\\n${JSON.stringify(mod, null, 2)}\\nmodule: must be a string`);\n\t\t\tthrow new ConfigError(\"\");\n\t\t}\n\n\t\t// `position` is optional, but must be a string when provided\n\t\tif (mod.position !== undefined && typeof mod.position !== \"string\") {\n\t\t\tLog.error(`This module configuration contains errors:\\n${JSON.stringify(mod, null, 2)}\\nposition: must be a string`);\n\t\t\tthrow new ConfigError(\"\");\n\t\t}\n\n\t\t// `position` is optional, but when set it must match a known region\n\t\tif (mod.position && !positionList.includes(mod.position)) {\n\t\t\tLog.warn(`Module ${index} (\"${mod.module}\") uses unknown position: \"${mod.position}\"`);\n\t\t\tLog.warn(`Known positions are: ${positionList.join(\", \")}`);\n\t\t}\n\t}\n\n\tLog.info(styleText(\"green\", \"Your modules structure configuration doesn't contain errors :)\"));\n};\n\nmodule.exports = { loadConfig, getModulePositions, moduleHasValidPosition, getAvailableModulePositions, checkConfigFile, ConfigError };\n","sourceCodeStart":258,"sourceCodeEnd":285,"githubUrl":"https://github.com/MagicMirrorOrg/MagicMirror/blob/4b4a59534f7da01e4030e46029fe9dd649a7675e/js/utils.js#L258-L285","documentation":"validateModulePositions verifies that each module entry's optional `position` matches a known region name (positionList). If a position is set but isn't one of the valid region strings, this warning prints the module index, name, and bad value; validation continues and the module will simply not be displayed in any region.","triggerScenarios":"A module config sets position to an unrecognized string like \"top\", \"bottom_left\", \"Top_Left\" (wrong case), or a made-up region.","commonSituations":"Typos in region names; copying positions from other dashboard frameworks; capitalization mistakes (positions are lowercase snake_case like upper_third, top_left, bottom_bar).","solutions":["Change position to one of the known values listed in the companion 'Known positions are:' warning.","Use exact lowercase snake_case: top_bar, top_left, top_center, top_right, upper_third, upper_left/center/right, middle_left/center/right, lower_left/center/right, bottom_bar, bottom_left, bottom_center, bottom_right, fullscreen_above, fullscreen_below.","Remove position entirely if the module doesn't need to be displayed."],"exampleFix":"// before\n{ module: \"clock\", position: \"Top_Left\" }\n// after\n{ module: \"clock\", position: \"top_left\" }","handlingStrategy":"validation","validationCode":"// validate positions before starting:\nconst valid = [\"top_bar\",\"top_left\",\"top_center\",\"top_right\",\"upper_third\",\"upper_left\",\"upper_center\",\"upper_right\",\"middle_left\",\"middle_center\",\"middle_right\",\"lower_third\",\"lower_left\",\"lower_center\",\"lower_right\",\"bottom_left\",\"bottom_center\",\"bottom_right\",\"bottom_bar\",\"fullscreen_above\",\"fullscreen_below\"];\nfor (const m of config.modules) {\n  if (m.position && !valid.includes(m.position)) throw new Error(`${m.module}: bad position ${m.position}`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy position strings from the docs rather than typing them","Remember positions are lowercase snake_case","Run `npm run config:check` after config edits","Keep a reference list of the 21 valid regions handy"],"tags":["config","positions","validation"],"backgroundTag":"invalid-region-position","analyzedSha":"4b4a59534f7da01e4030e46029fe9dd649a7675e","analyzedAt":"2026-08-31T21:49:42.591Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}