Mastra Cloud Deployment Failing Due to @mastra/cloud Version Incompatibility

I can't deploy my project to Mastra Cloud because of a version conflict that might be caused by your deployment system. The Problem: Your packages have incompatible version requirements: - @mastra/cloud requires @mastra/core versions 0.10.7-0.14.0
- @mastra/evals requires @mastra/core versions 0.15.3+ This makes it impossible to use both packages together. What I Tried: Attempt 1 - Using "latest" versions:
"@mastra/core": "latest",
"@mastra/evals": "latest"
"@mastra/core": "latest",
"@mastra/evals": "latest"
Failed: Version conflict during npm install Attempt 2 - Using specific compatible versions:
"@mastra/core": "^0.17.1",
"@mastra/evals": "^0.13.7",
"@mastra/cloud": "^0.1.15"
"@mastra/core": "^0.17.1",
"@mastra/evals": "^0.13.7",
"@mastra/cloud": "^0.1.15"
Local install works perfectlyMastra Cloud deployment still fails The Bug: Even though my package.json specifies "@mastra/evals": "^0.13.7", your cloud deployment system ignores this and tries to install @mastra/evals@"latest" during bundling, which recreates the same version conflict. Evidence: My local pnpm install succeeds, but your cloud bundler logs show:
npm error @mastra/evals@"latest" from the root project
npm error @mastra/evals@"latest" from the root project
This suggests your deployment system is overriding my package.json versions. Request: Are you able to either: 1. Update @mastra/cloud to support newer @mastra/core versions, OR
2. Tweak your cloud bundler to respect the exact package versions specified in package.json? Thanks! PS, If it is of any significance, I am in a monorepo setup. PPS, Here's the project: https://cloud.mastra.ai/lloyds-team/dashboard/projects/salmon-lemon-apartment/runtime/deployment
Mastra Cloud
The serverless platform for AI Agents
8 Replies
Unknown User
Unknown User4w ago
Message Not Public
Sign In & Join Server To View
Mastra Triager
GitHub
[DISCORD:1419671762030825563] Mastra Cloud Deployment Failing Due t...
This issue was created from Discord post: https://discord.com/channels/1309558646228779139/1419671762030825563 I can't deploy my project to Mastra Cloud because of a version conflict that might...
joneslloyd
joneslloydOP4w ago
Thanks for the detailed response re: The two-stage install process. Answers to your questions: 1. Can I build locally with pnpm mastra build? No – Local build fails consistently actually. 2. Issues with @mastra/evals? No previous issues. 3. Circular references? There are no obvious circular references. I also fixed all mixed TypeScript exports (like export { func, type Type }) by separating them into:
export { func } from "./module";
export type { Type } from "./module";
export { func } from "./module";
export type { Type } from "./module";
However, the build still fails because the Mastra builder (on the face of it) does not seem to be able to handle TypeScript type exports:
Failed to analyze Mastra application: ../core/src/server.ts (64:7):
Expected '{', got 'type' (Note that you need plugins to import files that are not JavaScript)
Failed to analyze Mastra application: ../core/src/server.ts (64:7):
Expected '{', got 'type' (Note that you need plugins to import files that are not JavaScript)
Even clean, separated export type { TypeName } syntax fails. It seems that the Mastra bundler marks @mastra/evals as "external" because it encounters TypeScript syntax it can't parse in my project's core package, which @mastra/evals depends on. The version conflict happens during the second (p)npm install when it tries to install the "external" package. The config warning occurs even though my export follows the suggested pattern:
export const mastra = new Mastra({
// our options
});
export const mastra = new Mastra({
// our options
});
I'm definitely interested in a call if that helps – I am OOO until Oct 2nd though. I believe that the reason the Mastra build fails is because Mastra's bundler performs a workspace-wide dependency analysis and fails when it encounters any TypeScript export type syntax anywhere in the dependency tree (even if the entry point doesn't use it).
Unknown User
Unknown User4w ago
Message Not Public
Sign In & Join Server To View
joneslloyd
joneslloydOP3w ago
Hi @Yujohn I was just wondering if you had chance to see my latest message on this
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
joneslloyd
joneslloydOP6d ago
Did the team have chance to look at this?
prompt
prompt6d ago
having the same issue

Did you find this page helpful?