{"record":{"id":"d9157453c8d9e6e9","repo":"Semantic-Org/Semantic-UI","slug":"console-cannot-be-restored-most-likely-it-was-ove","errorCode":null,"errorMessage":"Console cannot be restored, most likely it was overwritten outside of module","messagePattern":"Console cannot be restored, most likely it was overwritten outside of module","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/definitions/globals/site.js","lineNumber":431,"sourceCode":"  else {\n    if(instance !== undefined) {\n      module.destroy();\n    }\n    module.initialize();\n  }\n  return (returnedValue !== undefined)\n    ? returnedValue\n    : this\n  ;\n};\n\n$.site.settings = {\n\n  name        : 'Site',\n  namespace   : 'site',\n\n  error : {\n    console : 'Console cannot be restored, most likely it was overwritten outside of module',\n    method : 'The method you called is not defined.'\n  },\n\n  debug       : false,\n  verbose     : false,\n  performance : true,\n\n  modules: [\n    'accordion',\n    'api',\n    'checkbox',\n    'dimmer',\n    'dropdown',\n    'embed',\n    'form',\n    'modal',\n    'nag',\n    'popup',","sourceCodeStart":413,"sourceCodeEnd":449,"githubUrl":"https://github.com/Semantic-Org/Semantic-UI/blob/597843ab84d565cccfd8fd7719416350ae73e734/src/definitions/globals/site.js#L413-L449","documentation":"This error is logged by Semantic UI's site module when site.console(true) is called to restore the original window.console, but the cached reference (instance.cache.console) is undefined. The module disables console output by replacing window.console with a no-op stub and caches the original; if that cache was never populated (or was cleared), it cannot restore it. The message warns that something outside the module's lifecycle overwrote window.console.","triggerScenarios":"Calling $.site('enable.console') or $.site('console', true) without a prior disable, or when the module was re-initialized (instance destroyed) after disabling. Also triggered when another library or script has already replaced window.console before site.js cached it, so instance.cache.console stays undefined.","commonSituations":"Loading order issues where another framework (e.g., a logging shim or testing utility) replaces console before site.js initializes. Calling enable.console after page-level code already wiped or replaced console. Re-initializing the site module on an element after destroy() was called, which clears instance.cache.","solutions":["Ensure site console is disabled ($.site('disable.console')) before attempting to re-enable it; the cache is only populated on disable.","Do not re-initialize the site module ($.site()) after calling destroy(); start fresh on page load.","Remove or defer other scripts that overwrite window.console before site.js loads.","If you never need console suppression, simply avoid calling the console enable/disable API entirely."],"exampleFix":"// before\n$.site('enable.console'); // cache is undefined, error logged\n\n// after\n$.site('disable.console'); // populates cache\n$.site('enable.console');  // now restores correctly","handlingStrategy":"validation","validationCode":"// Before calling enable.console, verify the cache exists\nif ($.site && typeof $.site === 'function') {\n  var instance = $('body').data('module-site');\n  if (instance && instance.cache && instance.cache.console) {\n    $.site('enable.console');\n  } else {\n    console.warn('Console cache not available; skip restore.');\n  }\n}","typeGuard":"// Check whether the site module's console cache is populated\nfunction canRestoreConsole() {\n  var inst = $('body').data('module-site');\n  return !!(inst && inst.cache && typeof inst.cache.console === 'object');\n}","tryCatchPattern":null,"preventionTips":["Always call $.site('disable.console') before calling $.site('enable.console').","Avoid re-initializing the site module after destroy(); the cache is cleared.","Do not overwrite window.console with external code while the site module manages it."],"tags":["site","console","debugging","semantic-ui"],"backgroundTag":null,"analyzedSha":"597843ab84d565cccfd8fd7719416350ae73e734","analyzedAt":"2026-08-13T01:44:23.827Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}