Mastra Cloud deployment failing with `ERR_MODULE_NOT_FOUND` for `instrumentation.mjs`
BLUF:
Mastra Cloud deployment failing with
- Main: working fine in production
- Local: โ
- Mastra Cloud: โ fails with missing module error
--- โ ๏ธ Error --- ๐งช What We Tried - Verified all required env vars in Mastra Cloud
- Set
- Upgraded
- Updated all
- Commented out telemetry config entirely โ still references instrumentation in start cmd
- Local
- Set install cmd to
--- ๐ Key Finding Local builds succeed and generate all required files.
Mastra Cloudโs deployer seems not to generate
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 -
-
- All other
--- Need direct guidance to resolve this deployment blocker. ๐
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 --- ๐งช 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
๐ 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...
Hi @montel9705 ! Could you share your deployment id and project slug? Thanks ๐
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
Thanks, we'll look into it!
Hi @Romain were you able to find anything? Could you share some advise for how we can get this deployed?
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?
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)