M
MastraAIโ€ข3mo ago
Amos

Turborepo built package wrong type

I have my agents, workflows, tools etc. in a separate package that is built with tsc I then import them like so, for example:
import { myAgent } from "@mypackage/worker-core/agent";
import { myAgent } from "@mypackage/worker-core/agent";
but then I get the following type error when adding it to the agents object in new Mastra:
Type 'Agent<"my-agent", ToolsInput, Record<string, Metric>>' is not assignable to type 'Agent<any, ToolsInput, Record<string, Metric>>'.
Property '#private' in type 'Agent' refers to a different member that cannot be accessed from within type 'Agent'.ts(2322)
Type 'Agent<"my-agent", ToolsInput, Record<string, Metric>>' is not assignable to type 'Agent<any, ToolsInput, Record<string, Metric>>'.
Property '#private' in type 'Agent' refers to a different member that cannot be accessed from within type 'Agent'.ts(2322)
9 Replies
Mastra Triager
Mastra Triagerโ€ข3mo ago
๐Ÿ“ Created GitHub issue: https://github.com/mastra-ai/mastra/issues/6633
GitHub
[DISCORD:1402662641864019968] Turborepo built package wrong type ยท...
This issue was created from Discord post: https://discord.com/channels/1309558646228779139/1402662641864019968 I have my agents, workflows, tools etc. in a separate package that is built with tsc I...
Abhi Aiyer
Abhi Aiyerโ€ข3mo ago
Interesting @Amos are the versions of mastra the same between? Gonna tag in @LekoArts here
Amos
AmosOPโ€ข3mo ago
yes, 0.0.0-ai-v5-20250801192614. it builds fine and runs fine (I think) if I just @ts-ignore everything however having some other issues that are probably related to me being on the ai v5 branch (was getting errors with zod so trying to upgrade)
Abhi Aiyer
Abhi Aiyerโ€ข3mo ago
Ahhh. Well we are actively working on zod4 support and trying to get a non breaking version of v5 support in for this tuesdays release!
Abhi Aiyer
Abhi Aiyerโ€ข3mo ago
I added some info at the top of this post https://github.com/mastra-ai/mastra/issues/5470
GitHub
AI SDK v5 Support mega issue ยท Issue #5470 ยท mastra-ai/mastra
AI SDK v5 has been released! ๐ŸŽ‰ Interim We&#39;ve also released new @ai-v5 pre-release packages so you can try out v5 in Mastra! ๐Ÿš€ The new pre-release packages contain a backwards compatibility laye...
Abhi Aiyer
Abhi Aiyerโ€ข3mo ago
hopefully things will smooth out soon, sorry for any inconvenience right now
Amos
AmosOPโ€ข3mo ago
gonna try going back to the other mastra version and see if it persists. reason why I was switching was cus the mastra client was erroring that it couldnt find ZodInstance or something works on the older version ๐Ÿ˜„ @Abhi Aiyer was also having other issues on there where the input labels on the playground were missing and it wasn't actually passing the input on the ai v5 version anyway gotta say mastra is super nice so far despite these small issues. switched from pg-boss to dbos and now to mastra and think I finally found something good for my workflows
LekoArts
LekoArtsโ€ข3mo ago
Hello @Amos ๐Ÿ‘‹ Did you resolve your original issue (https://github.com/mastra-ai/mastra/issues/6633) ? I think you did but wanted to make sure before closing out the issue. Thanks!
GitHub
[DISCORD:1402662641864019968] Turborepo built package wrong type ยท...
This issue was created from Discord post: https://discord.com/channels/1309558646228779139/1402662641864019968 I have my agents, workflows, tools etc. in a separate package that is built with tsc I...
Amos
AmosOPโ€ข3mo ago
it was only happening on the ai v5 version of mastra so will check again once that is made stable

Did you find this page helpful?