siyuan-note/siyuan · error

plugin ${plugin.name} has already been loaded

Error message

plugin ${plugin.name} has already been loaded

What it means

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.

Source

Thrown at app/src/plugin/loader.ts:95

        }) as Plugin;
        insertPluginCSS(item, getPluginsStyle());
        return plugin;
    } catch (error) {
        document.getElementById("pluginsStyle" + item.name)?.remove();
        throw error;
    }
};

const getLifecycleManager = (app: App) => {
    let manager = lifecycleManagers.get(app);
    if (manager) {
        return manager;
    }
    manager = new PluginLifecycleCoordinator<IPluginData, Plugin>({
        create: (item) => createPlugin(app, item),
        attach: (plugin) => {
            if (app.plugins.some((item) => item.name === plugin.name)) {
                throw new Error(`plugin ${plugin.name} has already been loaded`);
            }
            app.plugins.push(plugin);
        },
        onload: (plugin) => plugin.onload(),
        init: (plugin) => plugin.kernel.init(),
        onLayoutReady: (plugin) => plugin.onLayoutReady(),
        mount: (plugin) => {
            mountPlugin(plugin);
            activateCustomBlockPlugin(plugin.name);
        },
        shouldReloadOnDataChange: (plugin) => plugin.onDataChanged === Plugin.prototype.onDataChanged,
        onDataChanged: (plugin, reason) => plugin.onDataChanged(reason),
        onunload: (plugin) => {
            deactivateCustomBlockPlugin(plugin.name);
            beginPluginTeardown(plugin);
            return plugin.onunload();
        },
        uninstall: (plugin) => plugin.uninstall(),

View on GitHub (pinned to 8641553a1f)

Solutions

  1. Unload or disable the existing plugin before loading another copy
  2. Ensure plugin names are unique across installed plugins
  3. Reinstall the single intended version of the plugin
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at app/src/plugin/loader.ts:95 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of siyuan-note/siyuan@8641553a1f (2026-09-11). Data as JSON: /api/errors/6d651e69ff667fc7. Report an issue: GitHub.