{"record":{"id":"40f09d02da537f05","repo":"MagicMirrorOrg/MagicMirror","slug":"warning-your-custom-css-file-was-moved-from-glo","errorCode":null,"errorMessage":"WARNING! Your custom css file was moved from ${global.root_path}/css/custom.css to ${global.root_path}/${env.customCss}","messagePattern":"WARNING! Your custom css file was moved from (.+?)/css/custom\\.css to (.+?)/(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"js/app.js","lineNumber":205,"sourceCode":"\t\ttry {\n\t\t\tconst configObj = Utils.loadConfig();\n\t\t\tglobal.config = configObj.fullConf;\n\t\t\t// Keep a copy of the redacted config to later verify module secret permissions\n\t\t\tglobal.configRedacted = configObj.redactedConf;\n\t\t\tconst config = global.config;\n\t\t\tUtils.checkConfigFile(configObj);\n\n\t\t\tglobal.defaultModulesDir = config.defaultModulesDir;\n\t\t\tdefaultModules = require(`${global.root_path}/${global.defaultModulesDir}/defaultmodules`);\n\n\t\t\tLog.setLogLevel(config.logLevel);\n\n\t\t\tenv = getEnvVarsAsObj();\n\t\t\t// check for deprecated css/custom.css and move it to new location\n\t\t\tif ((!fs.existsSync(`${global.root_path}/${env.customCss}`)) && (fs.existsSync(`${global.root_path}/css/custom.css`))) {\n\t\t\t\ttry {\n\t\t\t\t\tfs.renameSync(`${global.root_path}/css/custom.css`, `${global.root_path}/${env.customCss}`);\n\t\t\t\t\tLog.warn(`WARNING! Your custom css file was moved from ${global.root_path}/css/custom.css to ${global.root_path}/${env.customCss}`);\n\t\t\t\t} catch {\n\t\t\t\t\tLog.warn(\"WARNING! Your custom css file is currently located in the css folder. Please move it to the config folder!\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// get the used module positions\n\t\t\tUtils.getModulePositions();\n\n\t\t\tlet modules = [];\n\t\t\tfor (const module of config.modules) {\n\t\t\t\tif (module.disabled) continue;\n\t\t\t\tif (module.module) {\n\t\t\t\t\tif (Utils.moduleHasValidPosition(module.position) || typeof (module.position) === \"undefined\") {\n\t\t\t\t\t\t// Only add this module to be loaded if it is not a duplicate (repeated instance of the same module)\n\t\t\t\t\t\tif (!modules.includes(module.module)) {\n\t\t\t\t\t\t\tmodules.push(module.module);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/MagicMirrorOrg/MagicMirror/blob/4b4a59534f7da01e4030e46029fe9dd649a7675e/js/app.js#L187-L223","documentation":"On startup, App() checks for the legacy custom stylesheet at css/custom.css. If the configured target (env.customCss, default config/custom.css) doesn't exist but the old file does, it renames the file to the new location and logs this migration warning. It's informational: the move already happened; only a failure to rename falls into the follow-up warning.","triggerScenarios":"First start after upgrading MagicMirror² while the user's custom.css still resides at <root>/css/custom.css and <root>/<env.customCss> (default config/custom.css) does not exist yet.","commonSituations":"Upgrading an old install in place; Docker containers mounting only css/custom.css; overridden CUSTOMCSS env var pointing elsewhere while old file lingers.","solutions":["No action needed — the file was moved automatically; verify your styles load from the new path (default config/custom.css).","Update deployment/backup scripts and Docker volume mounts to reference the new css path.","If you rely on the old location intentionally, keep it synchronized or set the customCss env var appropriately."],"exampleFix":"// before\nvolumes: [\"./css/custom.css:/opt/magic-mirror/css/custom.css\"]\n// after\nvolumes: [\"./custom.css:/opt/magic-mirror/config/custom.css\"]","handlingStrategy":"fallback","validationCode":"const fs = require(\"fs\");\nconst target = `${global.root_path}/config/custom.css`;\nconst legacy = `${global.root_path}/css/custom.css`;\nif (!fs.existsSync(target) && fs.existsSync(legacy)) {\n  console.log(\"Legacy custom.css will be migrated on next start\");\n}","typeGuard":null,"tryCatchPattern":"// wrap any manual migration so a failure doesn't block startup\ntry {\n  fs.renameSync(\"css/custom.css\", \"config/custom.css\");\n} catch {\n  console.warn(\"Move css/custom.css to config/custom.css manually\");\n}","preventionTips":["Keep custom.css in config/ (new default location) on fresh installs.","Update Docker volume mounts and backup scripts to the new path.","After upgrades, read startup warnings and address them once rather than ignoring them."],"tags":["migration","filesystem","config"],"backgroundTag":"deprecated-file-location","analyzedSha":"4b4a59534f7da01e4030e46029fe9dd649a7675e","analyzedAt":"2026-08-31T21:49:42.591Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}