{"record":{"id":"51f166f98db722aa","repo":"mastra-ai/mastra","slug":"mastra-auth-ee-configuredfeatures-join-and","errorCode":null,"errorMessage":"[mastra/auth-ee] ${configuredFeatures.join(' and ')} ${configuredFeatures.length === 1 ? 'is' : 'are'} configured but the EE module (@mastra/core/auth/ee) could not be loaded.\nEnsure @mastra/core is updated to a version that includes EE support.","messagePattern":"\\[mastra/auth-ee\\] (.+?) (.+?) configured but the EE module \\(@mastra/core/auth/ee\\) could not be loaded\\.\nEnsure @mastra/core is updated to a version that includes EE support\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"packages/server/src/server/server-adapter/index.ts","lineNumber":864,"sourceCode":"    if (configuredFeatures.length === 0) return;\n\n    try {\n      const { isEEEnabled } = await import('@mastra/core/auth/ee');\n      if (!isEEEnabled()) {\n        const featureList = configuredFeatures.join(' and ');\n        throw new Error(\n          `[mastra/auth-ee] ${featureList} ${configuredFeatures.length === 1 ? 'is' : 'are'} configured but no valid EE license was found.\\n` +\n            `${featureList} ${configuredFeatures.length === 1 ? 'requires' : 'require'} a Mastra Enterprise License for production use.\\n` +\n            'Set the MASTRA_EE_LICENSE environment variable with your license key.\\n' +\n            'Learn more: https://github.com/mastra-ai/mastra/blob/main/ee/LICENSE',\n        );\n      }\n    } catch (err) {\n      if (err instanceof Error && err.message.startsWith('[mastra/auth-ee]')) {\n        throw err;\n      }\n      // @mastra/core/auth/ee module not available; EE authorization cannot function.\n      throw new Error(\n        `[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` +\n          'Ensure @mastra/core is updated to a version that includes EE support.',\n      );\n    }\n  }\n\n  /**\n   * Validate that an Agent Builder configuration has a valid EE license.\n   * Throws if the editor is configured with builder support but no valid EE license is available.\n   */\n  async validateAgentBuilderLicense(): Promise<void> {\n    const editor = this.mastra.getEditor();\n    if (!editor?.hasEnabledBuilderConfig?.()) return;\n\n    try {\n      const { isEEEnabled } = await import('@mastra/core/auth/ee');\n      if (!isEEEnabled()) {\n        throw new Error(","sourceCodeStart":846,"sourceCodeEnd":882,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/server/src/server/server-adapter/index.ts#L846-L882","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Upgrade @mastra/core to a version that includes EE support (matching the server package's peer requirement).","Run pnpm install / rebuild so node_modules contains the current @mastra/core dist.","Verify `import('@mastra/core/auth/ee')` resolves in your runtime (check package.json exports of @mastra/core).","If version pinning is intentional, downgrade the server package to a version compatible with your @mastra/core."],"exampleFix":"// before (package.json)\n\"@mastra/core\": \"0.10.0\",\n\"@mastra/server\": \"0.12.0\"\n\n// after\n\"@mastra/core\": \"0.12.0\",\n\"@mastra/server\": \"0.12.0\"","handlingStrategy":"validation","validationCode":"let eeAvailable = false;\ntry {\n  await import('@mastra/core/auth/ee');\n  eeAvailable = true;\n} catch {\n  throw new Error('EE features configured but @mastra/core/auth/ee is unavailable — upgrade @mastra/core to a version with EE support');\n}","typeGuard":"function isEeModuleMissing(err: unknown): boolean {\n  return err instanceof Error &&\n    err.message.includes('[mastra/auth-ee]') &&\n    err.message.includes('could not be loaded');\n}","tryCatchPattern":"try {\n  await startServer(mastra);\n} catch (e) {\n  if (isEeModuleMissing(e)) {\n    console.error('Update @mastra/core (and rebuild/install) so @mastra/core/auth/ee resolves.');\n    process.exitCode = 1;\n    return;\n  }\n  throw e;\n}","preventionTips":["Keep @mastra/core at the same (or newer, compatible) version as all @mastra/* server packages.","Run pnpm install and rebuild workspace packages after version bumps.","In CI, assert the auth/ee subpath export resolves before deploying EE-enabled builds.","Avoid bundler configs that break dynamic subpath imports of @mastra/core."],"tags":["licensing","enterprise","module-resolution","version-mismatch","startup"],"backgroundTag":"module-not-found","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}