MagicMirrorOrg/MagicMirror · warning

Invalid module position found for this configuration

Error message

Invalid module position found for this configuration:
${JSON.stringify(module, null, 2)}

What it means

While collecting the modules to load, App validates each module's position against the known position list via Utils.moduleHasValidPosition. If a module in config.js declares a position string that is not one of the valid MagicMirror regions (and is not undefined), the module is skipped and this warning is logged.

Solutions

  1. Fix the position string to one of the valid regions: upper_third, upper_left, upper_center, upper_right, middle_center, lower_third, lower_left, lower_center, lower_right, bottom_bar, top_bar, fullscreen_above, fullscreen_below.
  2. Remove the position property entirely if the module should be positionless (some modules require it to be omitted).
  3. Check the module's own documentation — some positions are only valid for specific modules.
  4. Consult js/module_positions or the MagicMirror docs for the exact allowed position strings.

Example fix

// before (config.js)
{ module: "clock", position: "top_left_corner" }
// after
{ module: "clock", position: "top_left" }
Defensive patterns

Strategy: validation

Validate before calling

const VALID_POSITIONS = ["top_bar","upper_third","upper_left","upper_center","upper_right","middle_center","lower_third","lower_left","lower_center","lower_right","bottom_bar","fullscreen_above","fullscreen_below"];
config.modules.forEach((m, i) => {
  if (m.position && !VALID_POSITIONS.includes(m.position)) {
    console.warn(`Module #${i} (${m.module}) has invalid position: ${m.position}`);
  }
});

Type guard

function hasValidPosition(module) {
  return typeof module.position === "undefined" || VALID_POSITIONS.includes(module.position);
}

Try / catch

null

Prevention

When it happens

Trigger: A config.js module entry has a position value that is a defined string but not a valid region name, e.g. position: 'top_left' instead of 'top_left' correct spelling, 'bottom_bar' typos, or a position that only certain modules support (e.g. 'fullscreen_above' misuse), so Utils.moduleHasValidPosition returns false.

Common situations: Typos like 'topleft', 'top_left corner', or copied positions from third-party module READMEs; assigning a non-region position to a clock/calendar module; positions valid only for special modules (e.g. 'fullscreen_below') applied to regular ones.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of MagicMirrorOrg/MagicMirror@4b4a59534f (2026-08-31). Data as JSON: /api/errors/64883c396c32b62a. Report an issue: GitHub.

Appendix: source

Thrown at js/app.js:224

				} catch {
					Log.warn("WARNING! Your custom css file is currently located in the css folder. Please move it to the config folder!");
				}
			}

			// get the used module positions
			Utils.getModulePositions();

			let modules = [];
			for (const module of config.modules) {
				if (module.disabled) continue;
				if (module.module) {
					if (Utils.moduleHasValidPosition(module.position) || typeof (module.position) === "undefined") {
						// Only add this module to be loaded if it is not a duplicate (repeated instance of the same module)
						if (!modules.includes(module.module)) {
							modules.push(module.module);
						}
					} else {
						Log.warn("Invalid module position found for this configuration:" + `\n${JSON.stringify(module, null, 2)}`);
					}
				} else {
					Log.warn("No module name found for this configuration:" + `\n${JSON.stringify(module, null, 2)}`);
				}
			}

			setGlobalDispatcher(new Agent({ connect: { timeout: fetch_timeout } }));

			await loadModules(modules);

			httpServer = new Server(configObj);
			const { app, io } = await httpServer.open();
			Log.log("Server started ...");

			const nodePromises = [];
			for (let nodeHelper of nodeHelpers) {
				nodeHelper.setExpressApp(app);
				nodeHelper.setSocketIO(io);

View on GitHub (pinned to 4b4a59534f)