{"record":{"id":"6d651e69ff667fc7","repo":"siyuan-note/siyuan","slug":"plugin-plugin-name-has-already-been-loaded","errorCode":null,"errorMessage":"plugin ${plugin.name} has already been loaded","messagePattern":"plugin (.+?) has already been loaded","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/plugin/loader.ts","lineNumber":95,"sourceCode":"        }) as Plugin;\n        insertPluginCSS(item, getPluginsStyle());\n        return plugin;\n    } catch (error) {\n        document.getElementById(\"pluginsStyle\" + item.name)?.remove();\n        throw error;\n    }\n};\n\nconst getLifecycleManager = (app: App) => {\n    let manager = lifecycleManagers.get(app);\n    if (manager) {\n        return manager;\n    }\n    manager = new PluginLifecycleCoordinator<IPluginData, Plugin>({\n        create: (item) => createPlugin(app, item),\n        attach: (plugin) => {\n            if (app.plugins.some((item) => item.name === plugin.name)) {\n                throw new Error(`plugin ${plugin.name} has already been loaded`);\n            }\n            app.plugins.push(plugin);\n        },\n        onload: (plugin) => plugin.onload(),\n        init: (plugin) => plugin.kernel.init(),\n        onLayoutReady: (plugin) => plugin.onLayoutReady(),\n        mount: (plugin) => {\n            mountPlugin(plugin);\n            activateCustomBlockPlugin(plugin.name);\n        },\n        shouldReloadOnDataChange: (plugin) => plugin.onDataChanged === Plugin.prototype.onDataChanged,\n        onDataChanged: (plugin, reason) => plugin.onDataChanged(reason),\n        onunload: (plugin) => {\n            deactivateCustomBlockPlugin(plugin.name);\n            beginPluginTeardown(plugin);\n            return plugin.onunload();\n        },\n        uninstall: (plugin) => plugin.uninstall(),","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/8641553a1f07374001902d3ce773285db1292b2d/app/src/plugin/loader.ts#L77-L113","documentation":"Plugin loader attach-step guard: the PluginLifecycleCoordinator tried to attach a newly created plugin whose name already exists in app.plugins. A plugin with the same name is already loaded, so registering again would duplicate it.","triggerScenarios":"Thrown at app/src/plugin/loader.ts:95 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Unload or disable the existing plugin before loading another copy","Ensure plugin names are unique across installed plugins","Reinstall the single intended version of the plugin"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"8641553a1f07374001902d3ce773285db1292b2d","analyzedAt":"2026-09-11T16:08:28.414Z","contentChangedAt":"2026-09-11T16:08:28.414Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}