M
MastraAIโ€ข5d ago
montel9705

Mastra Cloud deployment failing with `ERR_MODULE_NOT_FOUND` for `instrumentation.mjs`

BLUF:
Mastra Cloud deployment failing with ERR_MODULE_NOT_FOUND for instrumentation.mjs โ€” file not being generated during cloud build despite working locally. --- ๐Ÿงฉ Environment - Branch: dev (deploy target)
- Main: working fine in production
- Local: โœ… mastra@0.13.2 + @mastra/core@0.18.0 builds successfully
- Mastra Cloud: โŒ fails with missing module error
--- โš ๏ธ Error
Error [ERR_MODULE_NOT_FOUND]: Cannot find module
'/mnt/filestore/data/project/.mastra/output/instrumentation.mjs'
imported from /mnt/filestore/data/project/.mastra/output/
Error [ERR_MODULE_NOT_FOUND]: Cannot find module
'/mnt/filestore/data/project/.mastra/output/instrumentation.mjs'
imported from /mnt/filestore/data/project/.mastra/output/
--- ๐Ÿงช What We Tried - Verified all required env vars in Mastra Cloud
- Set MASTRA_TELEMETRY_DISABLED=1 โ†’ still fails
- Upgraded mastra@0.13.2 โ†’ 0.16.0 โ†’ breaks local build with Pinecone bundling error
"default" is not exported by node:stream?commonjs-external
- Updated all @mastra/* packages to match CLI peers โ†’ still fails
- Commented out telemetry config entirely โ†’ still references instrumentation in start cmd
- Local mastra build does generate instrumentation.mjs + telemetry-config.mjs
- Set install cmd to pnpm install --frozen-lockfile in Cloud settings
--- ๐Ÿ” Key Finding Local builds succeed and generate all required files.
Mastra Cloudโ€™s deployer seems not to generate instrumentation.mjs, even though
.mastra/output/package.json references it in the start command. --- โ“ Questions 1. Does Mastra Cloud use a different build process than mastra build CLI?
2. Any known issues with instrumentation file generation in the Cloud deployer?
3. Way to force Mastra Cloud to clear/rebuild cache?
4. Recommended deployment approach when telemetry setup causes build failures? --- ๐Ÿ“ฆ Versions - mastra@0.13.2 (local - works)
- @mastra/core@0.18.0
- All other @mastra/* packages aligned with CLI dependencies
--- Need direct guidance to resolve this deployment blocker. ๐Ÿ™
6 Replies
Mastra Triager
Mastra Triagerโ€ข5d ago
๐Ÿ“ Created GitHub issue: https://github.com/mastra-ai/mastra/issues/8912
GitHub
[DISCORD:1428149397971013732] Mastra Cloud deployment failing with ...
This issue was created from Discord post: https://discord.com/channels/1309558646228779139/1428149397971013732 BLUF: Mastra Cloud deployment failing with ERR_MODULE_NOT_FOUND for instrumentation.mj...
_roamin_
_roamin_โ€ข5d ago
Hi @montel9705 ! Could you share your deployment id and project slug? Thanks ๐Ÿ™
montel9705
montel9705OPโ€ข5d ago
Deployment ID: 37767e38-07ed-40f3-9f95-9e3e6bb30be4 Project Slug: https://cloud.mastra.ai/louiss-team-short-old-rapid-oyster/dashboard/projects/lemon-quiet-zoo/runtime I haven't been able to successfully deploy this Dev Project so it doesn't have a stable url My main branch is connected to this slug if its helpful https://elvis.mastra.cloud
Mastra Cloud
The serverless platform for AI Agents
_roamin_
_roamin_โ€ข5d ago
Thanks, we'll look into it!
montel9705
montel9705OPโ€ข3d ago
Hi @Romain were you able to find anything? Could you share some advise for how we can get this deployed?
_roamin_
_roamin_โ€ข3d ago
Hey, sorry, I haven't gotten an answer yet, let me follow up. Hey @montel9705 ! Can you try adding this to your package.json and redeploy?
{
"overrides": {
"@rollup/plugin-commonjs": "28.0.6"
}
}
{
"overrides": {
"@rollup/plugin-commonjs": "28.0.6"
}
}
There's currently an issue with this package and it's breaking our bundler (your might need to put the "overrides" under the "pnpm" key in your package.json depending on which package manager you're using)

Did you find this page helpful?