Skip to content

mastra studio deploy fails: extractTrajectoryFromTrace not exported from @mastra/core/evals #15332

@obrunobspaiva

Description

@obrunobspaiva

Bug Report

Description

mastra studio deploy creates the project successfully but the deployed server fails to start with a SyntaxError about a missing export in @mastra/core/evals.

Environment

  • mastra: 1.5.0 (latest)
  • @mastra/core: 1.24.1 (latest)
  • @mastra/memory: 1.15.0
  • @mastra/pg: 1.9.0
  • @mastra/observability: 1.9.0
  • Node.js: v22.14.0 (local), v22.22.2 (platform sandbox)
  • OS: Windows 11

Steps to Reproduce

  1. Set up a Mastra project with @mastra/core@1.24.1 and mastra@1.5.0
  2. Run mastra studio deploy
  3. Build completes successfully (Build completed ~90s)
  4. Artifact is uploaded and deployed to sandbox
  5. Server fails to start

Error

file:///home/daytona/app/output/index.mjs:30
import { extractTrajectoryFromTrace, listScoresResponseSchema as listScoresResponseSchema$1 } from '@mastra/core/evals';
^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: The requested module '@mastra/core/evals' does not provide an export named 'extractTrajectoryFromTrace'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:226:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:335:5)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:665:26)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5)
Node.js v22.22.2
Start failed after 1m34s: Server failed to become healthy after 30 attempts
Failed: Server failed to become healthy after 30 attempts

Deploy Logs

Creating sandbox... (3.0s)
Downloading artifact... (2.1s)
Injecting platform config... (13.8s)
Installing dependencies... (10.9s)
Startup script written (0.1s)
[error above]

Analysis

The bundled output/index.mjs (generated by mastra build) imports extractTrajectoryFromTrace from @mastra/core/evals. However, the @mastra/core@1.24.1 package (latest on npm) does not export this symbol.

It appears the platform is injecting a version of @mastra/core during "Injecting platform config" step that is either:

  • An older version that doesn't have this export yet, OR
  • A newer internal version that the bundler references but isn't published to npm

The result is a version mismatch between the bundled code and the installed package on the platform.

Expected Behavior

mastra studio deploy should successfully start the server after deployment.

Workaround

None found. The issue reproduces consistently on every deploy attempt with the latest published versions.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions