Foundry376/Mailspring · error

Cannot load ${filePath}: Mailspring no longer ships with a T

Error message

Cannot load ${filePath}: Mailspring no longer ships with a TypeScript compiler. Plugins must be compiled to vanilla JavaScript as a pre-publish step.

What it means

Raised by the require.extensions shim installed in compile-cache-ts-unsupported when a plugin tries to require a .ts/.tsx/.jsx/.es6 file at runtime. It fires because Mailspring dropped its bundled just-in-time TypeScript compiler; plugin code must be pre-compiled to plain JavaScript before publishing.

Source

Thrown at app/src/compile-cache-ts-unsupported.js:29

  const dialog =
    process.type === 'renderer'
      ? require('@electron/remote').dialog
      : require('electron').dialog;
  dialog.showErrorBox(
    'Plugin must be compiled',
    `Mailspring no longer ships with a TypeScript compiler to recompile plugins on the fly. ` +
      `Ask the plugin developer to compile the plugin to vanilla JavaScript as a pre-publish step.` +
      `\n\nFile: ${filePath}`
  );
}

['.ts', '.tsx', '.jsx', '.es6'].forEach(extension => {
  Object.defineProperty(require.extensions, extension, {
    enumerable: true,
    writable: true,
    value: (module, filePath) => {
      showDialog(filePath);
      throw new Error(
        `Cannot load ${filePath}: Mailspring no longer ships with a TypeScript compiler. ` +
          `Plugins must be compiled to vanilla JavaScript as a pre-publish step.`
      );
    },
  });
});

View on GitHub (pinned to 648c685d60)

Solutions

  1. As the plugin developer: add a build step (e.g. tsc or babel) and ship compiled .js in the plugin package
  2. As the user: update the plugin to a version that ships compiled JavaScript, or disable it
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at app/src/compile-cache-ts-unsupported.js:29 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/00572bf3aaf70e7c. Report an issue: GitHub.