mastra-ai/mastra · critical · Error

[mastra/auth-ee] ${configuredFeatures.join(' and ')} ${confi

Error message

[mastra/auth-ee] ${configuredFeatures.join(' and ')} ${configuredFeatures.length === 1 ? 'is' : 'are'} configured but the EE module (@mastra/core/auth/ee) could not be loaded.
Ensure @mastra/core is updated to a version that includes EE support.

What it means

Thrown when EE features are configured but the dynamic import of @mastra/core/auth/ee fails (the `isEEEnabled` module can't be loaded). This means the installed @mastra/core predates EE support or the module resolution failed, so EE authorization cannot function and the adapter aborts with an actionable message. Errors already tagged [mastra/auth-ee] (like the license error) are rethrown unchanged.

Source

Thrown at packages/server/src/server/server-adapter/index.ts:864

    if (configuredFeatures.length === 0) return;

    try {
      const { isEEEnabled } = await import('@mastra/core/auth/ee');
      if (!isEEEnabled()) {
        const featureList = configuredFeatures.join(' and ');
        throw new Error(
          `[mastra/auth-ee] ${featureList} ${configuredFeatures.length === 1 ? 'is' : 'are'} configured but no valid EE license was found.\n` +
            `${featureList} ${configuredFeatures.length === 1 ? 'requires' : 'require'} a Mastra Enterprise License for production use.\n` +
            'Set the MASTRA_EE_LICENSE environment variable with your license key.\n' +
            'Learn more: https://github.com/mastra-ai/mastra/blob/main/ee/LICENSE',
        );
      }
    } catch (err) {
      if (err instanceof Error && err.message.startsWith('[mastra/auth-ee]')) {
        throw err;
      }
      // @mastra/core/auth/ee module not available; EE authorization cannot function.
      throw new Error(
        `[mastra/auth-ee] ${configuredFeatures.join(' and ')} ${configuredFeatures.length === 1 ? 'is' : 'are'} configured but the EE module (@mastra/core/auth/ee) could not be loaded.\n` +
          'Ensure @mastra/core is updated to a version that includes EE support.',
      );
    }
  }

  /**
   * Validate that an Agent Builder configuration has a valid EE license.
   * Throws if the editor is configured with builder support but no valid EE license is available.
   */
  async validateAgentBuilderLicense(): Promise<void> {
    const editor = this.mastra.getEditor();
    if (!editor?.hasEnabledBuilderConfig?.()) return;

    try {
      const { isEEEnabled } = await import('@mastra/core/auth/ee');
      if (!isEEEnabled()) {
        throw new Error(

View on GitHub (pinned to 75dd419e61)

Solutions

  1. Upgrade @mastra/core to a version that includes EE support (matching the server package's peer requirement).
  2. Run pnpm install / rebuild so node_modules contains the current @mastra/core dist.
  3. Verify `import('@mastra/core/auth/ee')` resolves in your runtime (check package.json exports of @mastra/core).
  4. If version pinning is intentional, downgrade the server package to a version compatible with your @mastra/core.

Example fix

// before (package.json)
"@mastra/core": "0.10.0",
"@mastra/server": "0.12.0"

// after
"@mastra/core": "0.12.0",
"@mastra/server": "0.12.0"
Defensive patterns

Strategy: validation

Validate before calling

let eeAvailable = false;
try {
  await import('@mastra/core/auth/ee');
  eeAvailable = true;
} catch {
  throw new Error('EE features configured but @mastra/core/auth/ee is unavailable — upgrade @mastra/core to a version with EE support');
}

Type guard

function isEeModuleMissing(err: unknown): boolean {
  return err instanceof Error &&
    err.message.includes('[mastra/auth-ee]') &&
    err.message.includes('could not be loaded');
}

Try / catch

try {
  await startServer(mastra);
} catch (e) {
  if (isEeModuleMissing(e)) {
    console.error('Update @mastra/core (and rebuild/install) so @mastra/core/auth/ee resolves.');
    process.exitCode = 1;
    return;
  }
  throw e;
}

Prevention

When it happens

Trigger: Configuring EE features while @mastra/core is an older version without the auth/ee subpath export, a broken/partial install (missing node_modules entries), or a bundler/resolver that cannot dynamically import the subpath.

Common situations: Version mismatch: @mastra/server or @mastra/core EE-consuming packages newer than @mastra/core; monorepo with stale builds; pnpm/workspace installs where @mastra/core dist wasn't built; bundlers tree-shaking or failing on dynamic import of subpath exports.

Related errors


AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30). Data as JSON: /api/errors/51f166f98db722aa. Report an issue: GitHub.