Foundry376/Mailspring · error · Error

Could not find a file at path '%@'

Error message

Could not find a file at path '%@'

What it means

ThemeManager.requireStylesheet could not resolve the given stylesheet path to an existing .css or .less file via resolveStylesheetPath. Raised when a theme or core code loads a stylesheet whose path is wrong, the theme is missing files, or the theme's package manifest references a nonexistent file.

Source

Thrown at app/src/theme-manager.ts:276

    if (this._systemAccentDisposable) {
      this._systemAccentDisposable.dispose();
      this._systemAccentDisposable = null;
    }
    if (color) {
      this._systemAccentDisposable = AppEnv.styles.addStyleSheet(buildSystemAccentCSS(color), {
        sourcePath: SYSTEM_ACCENT_SOURCE_PATH,
        priority: 2,
      });
    }
  }

  // Section: Private
  // ------

  requireStylesheet(stylesheetPath) {
    const sourcePath = this.resolveStylesheetPath(stylesheetPath);
    if (!sourcePath) {
      throw new Error(localized(`Could not find a file at path '%@'`, stylesheetPath));
    }
    const content = this.cssContentsOfStylesheet(sourcePath);
    this.styleSheetDisposablesBySourcePath[sourcePath] = AppEnv.styles.addStyleSheet(content, {
      priority: -1,
      sourcePath,
    });
  }

  loadStaticStylesheets() {
    this.requireStylesheet('../static/style/index');
    this.requireStylesheet('../static/style/email-frame');
  }

  resolveStylesheetPath(stylesheetPath) {
    if (path.extname(stylesheetPath).length > 0) {
      const p = path.resolve(__dirname, stylesheetPath);
      return fs.existsSync(p) ? p : null;
    }

View on GitHub (pinned to 648c685d60)

Solutions

  1. Fix the stylesheet path passed to requireStylesheet (relative paths resolve against the theme/package directory)
  2. Check the active theme's package.json lists files that actually exist
  3. Switch back to the default theme to isolate whether the theme package is broken or incomplete
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at app/src/theme-manager.ts:276 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Foundry376/Mailspring@648c685d60 (2026-09-03). Data as JSON: /api/errors/f83e92559c71ddfe. Report an issue: GitHub.