{"record":{"id":"3529ba6f5a2e591d","repo":"Flow-Launcher/Flow.Launcher","slug":"unable-to-find-plugin-pluginid","errorCode":null,"errorMessage":"Unable to find plugin: {pluginId}","messagePattern":"Unable to find plugin: (.+?)","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"Flow.Launcher/PluginSettingsWindow.xaml.cs","lineNumber":31,"sourceCode":"{\n    private readonly Settings _settings;\n\n    public string PluginId { get; }\n\n    public PluginSettingsWindow(string pluginId)\n    {\n        _settings = Ioc.Default.GetRequiredService<Settings>();\n\n        if (string.IsNullOrWhiteSpace(pluginId)){\n            throw new ArgumentException(\"Plugin ID cannot be null or whitespace.\", nameof(pluginId));\n        }\n\n        PluginId = pluginId;\n\n        var pluginPair = PluginManager.GetPluginForId(pluginId);\n        if (pluginPair == null)\n        {\n            throw new InvalidOperationException($\"Unable to find plugin: {pluginId}\");\n        }\n\n        var pluginSettings = _settings.PluginSettings.GetPluginSettings(pluginId);\n        if (pluginSettings == null)\n        {\n            throw new InvalidOperationException($\"Unable to load settings for plugin: {pluginPair.Metadata.Name}\");\n        }\n\n        var pluginViewModel = new PluginViewModel\n        {\n            PluginPair = pluginPair,\n            PluginSettingsObject = pluginSettings,\n            IsExpanded = true,\n        };\n\n        DataContext = pluginViewModel;\n        Title = Localize.pluginSettingsWindowTitle(pluginPair.Metadata.Name);\n        InitializeComponent();","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/Flow-Launcher/Flow.Launcher/blob/7fc63b07bbaa10a0f0b2601487913fcba9ed24b0/Flow.Launcher/PluginSettingsWindow.xaml.cs#L13-L49","documentation":"Thrown by the PluginSettingsWindow constructor when PluginManager.GetPluginForId(pluginId) returns null. The guard is reached only after a non-blank pluginId check, so the ID is syntactically valid but no loaded plugin matches it. This is a programmer/wiring error rather than a runtime Shell failure: the caller asked for settings of a plugin the running Flow Launcher instance does not have loaded.","triggerScenarios":"Opening the settings window for a pluginId that was unloaded, disabled and garbage-collected, never installed, mistyped, or read from a stale bookmark/shortcut. Also occurs when the settings list is rendered against a plugins.json that has been edited externally and the ID no longer matches.","commonSituations":"A plugin was uninstalled but its settings row remains in the UI; the user is on a portable build whose Plugins folder differs from the installed build; the plugin ID changed between versions (renamed assembly) and the saved link points at the old ID; concurrent plugin load failed silently so GetPluginForId returns null.","solutions":["Before constructing PluginSettingsWindow, check PluginManager.GetPluginForId(pluginId) != null and skip the row otherwise.","Refresh the plugin list (PluginManager.ReloadData) before opening the window if plugins may have changed.","Include the pluginId in the message (it already does) and add a friendly dialog so the user can act on it.","Make PluginManager.GetPluginForId case-insensitive to defend against casing drift."],"exampleFix":"// before\nvar pluginPair = PluginManager.GetPluginForId(pluginId);\nif (pluginPair == null)\n{\n    throw new InvalidOperationException($\"Unable to find plugin: {pluginId}\");\n}\n\n// after - guard at the call site before opening the window\npublic static async Task OpenAsync(string pluginId)\n{\n    if (PluginManager.GetPluginForId(pluginId) is null)\n    {\n        App.API.ShowMsgError($\"Plugin '{pluginId}' is not loaded. It may have been uninstalled.\");\n        return;\n    }\n    new PluginSettingsWindow(pluginId).Show();\n}","handlingStrategy":"validation","validationCode":"if (PluginManager.GetPluginForId(pluginId) is null)\n{\n    App.API.ShowMsgError($\"Plugin '{pluginId}' is not loaded.\");\n    return;\n}","typeGuard":"static bool IsPluginLoaded(string id) => PluginManager.GetPluginForId(id) is not null;","tryCatchPattern":"try { new PluginSettingsWindow(pluginId).Show(); }\ncatch (InvalidOperationException ex) when (ex.Message.StartsWith(\"Unable to find plugin\")) { App.API.ShowMsgError(ex.Message); }","preventionTips":["Re-check plugin availability right before opening the window.","Refresh the plugin list after install/uninstall.","Make plugin ID lookup case-insensitive.","Remove stale settings rows when a plugin is uninstalled."],"tags":["plugin-manager","settings-window","wpf","validation","csharp"],"backgroundTag":null,"analyzedSha":"7fc63b07bbaa10a0f0b2601487913fcba9ed24b0","analyzedAt":"2026-08-13T14:54:20.914Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}