Flow-Launcher/Flow.Launcher · warning · DirectoryNotFoundException
Theme path can't be found <{path}>
Error message
Theme path can't be found <{path}> What it means
Thrown as DirectoryNotFoundException when GetThemePath(theme) returns null or empty for the requested theme name. There is an explicit catch (DirectoryNotFoundException) at line 438 that logs, shows a message box, and recursively falls back to Constant.DefaultTheme — so a non-default theme failure recovers automatically; only failure of the default theme itself propagates.
Source
Thrown at Flow.Launcher.Core/Resource/Theme.cs:419
var filePaths = Directory
.GetFiles(themeDirectory)
.Where(filePath => filePath.EndsWith(Extension) && !filePath.EndsWith("Base.xaml"))
.Select(GetThemeDataFromPath);
themes.AddRange(filePaths);
}
return themes.OrderBy(o => o.Name).ToList();
}
public bool ChangeTheme(string theme = null)
{
if (string.IsNullOrEmpty(theme)) theme = _settings.Theme;
string path = GetThemePath(theme);
try
{
if (string.IsNullOrEmpty(path))
throw new DirectoryNotFoundException($"Theme path can't be found <{path}>");
_settings.Theme = theme;
// Always allow re-loading default theme, in case of failure of switching to a new theme from default theme
if (_oldTheme != theme || theme == Constant.DefaultTheme)
{
_oldTheme = Path.GetFileNameWithoutExtension(_oldResource.Source.AbsolutePath);
}
// Check if blur is enabled
var dict = GetThemeResourceDictionary(theme);
BlurEnabled = Win32Helper.IsBackdropSupported() && IsThemeBlurEnabled(dict);
// Apply blur and drop shadow effect so that we do not need to call it again
_ = RefreshFrameAsync();
return true;
}View on GitHub (pinned to 7fc63b07bb)
Solutions
- Open Settings > Theme and pick an installed theme (or the default) to reset Settings.Theme.
- Confirm the theme's .xaml file exists under one of the configured theme directories and its filename matches the theme name.
- If the error recurs even after resetting, check that the default theme file (Constant.DefaultTheme) is present in the install directory — that is the final fallback.
- Verify read permissions on the theme directory for the current user.
Defensive patterns
Strategy: fallback
Validate before calling
if (string.IsNullOrEmpty(GetThemePath(theme)) && theme != Constant.DefaultTheme)
{ _api.ShowMsgBox(Localize.theme_load_failure_path_not_exists(theme)); ChangeTheme(Constant.DefaultTheme); return false; } Type guard
null
Try / catch
try { return ChangeTheme(theme); }
catch (DirectoryNotFoundException) when (theme != Constant.DefaultTheme)
{ return ChangeTheme(Constant.DefaultTheme); } Prevention
- Keep Settings.Theme pointed at an installed theme.
- After deleting a custom theme, switch Settings to the default.
- Confirm theme .xaml files exist before referencing them.
- Ensure read permissions on theme directories.
When it happens
Trigger: The user's Settings.Theme names a theme whose .xaml file was deleted or never installed; a theme was installed to a non-default theme directory that is no longer on the search path; the theme file extension or naming convention changed between versions and the stored name no longer resolves; GetThemePath returns empty for any reason (permissions, path corruption).
Common situations: User uninstalls/deletes a custom theme folder but leaves it set in Settings; portable/multi-machine setups where the theme directory differs; migration between Flow Launcher versions that relocated theme storage; antivirus blocking access to the theme folder so enumeration yields nothing.
Related errors
- Invalid file path
- Invalid corner type
- Plugin {newPlugin.ID} zip file not found at {filePath}
- Failed to deserialize double pinyin table: result is null
- DoublePinyinSchema '{schemaKey}' is invalid or double pinyin
AI-assisted analysis of Flow-Launcher/Flow.Launcher@7fc63b07bb (2026-08-13).
Data as JSON: /api/errors/e0b4b8b40076d32b.
Report an issue: GitHub.