M
MastraAI4w ago
Amos

type annotation error and property 'suspend' missing

upgraded from mastra "@mastra/core": "0.17.1", to "@mastra/core": "0.18.0", and getting the errors
Property 'suspend' is missing in type '{ context: { industry: s
tring; }; runtimeContext: RuntimeContext<unknown>; }' but require
d in type 'ToolExecutionContext<ZodObject<{ industry: ZodString;
}, $strip>, any, any>'.
Property 'suspend' is missing in type '{ context: { industry: s
tring; }; runtimeContext: RuntimeContext<unknown>; }' but require
d in type 'ToolExecutionContext<ZodObject<{ industry: ZodString;
}, $strip>, any, any>'.
and
The inferred ty
pe of 'upsertIndustryTool' cannot be named without a reference to
'.pnpm/ai@4.3.19_react@19.1.1_zod@4.1.11/node_modules/ai'. This
is likely not portable. A type annotation is necessary
The inferred ty
pe of 'upsertIndustryTool' cannot be named without a reference to
'.pnpm/ai@4.3.19_react@19.1.1_zod@4.1.11/node_modules/ai'. This
is likely not portable. A type annotation is necessary
12 Replies
Mastra Triager
GitHub
[DISCORD:1420533329131864255] type annotation error and property 's...
This issue was created from Discord post: https://discord.com/channels/1309558646228779139/1420533329131864255 upgraded from mastra &quot;@mastra/core&quot;: &quot;0.17.1&quot;, to &quot;@mastra/co...
_roamin_
_roamin_4w ago
Hi @Amos ! Could you share the code where you're getting this error?
Amos
AmosOP4w ago
for the suspend one
const { industryId } = await upsertIndustryTool.execute({
context: {
industry: text.trim(),
},
runtimeContext,
});
const { industryId } = await upsertIndustryTool.execute({
context: {
industry: text.trim(),
},
runtimeContext,
});
it's not the first time I've had the inferred type error either, so I guess it's a regression https://discord.com/channels/1309558646228779139/1413529332588085269 didn't check my reproduction if it still happens there, but it was fixed at one point yeah I updated my previous reproduction and the error happens again so you can check it there
_roamin_
_roamin_4w ago
Thanks for checking Amos! I'll reopen the GH issue
_roamin_
_roamin_4w ago
GitHub
[DISCORD:1413529332588085269] Type error in createTool · Issue #75...
This issue was created from Discord post: https://discord.com/channels/1309558646228779139/1413529332588085269 Hi, I upgraded the mastra packages to the latest, but now I&#39;m seeing type error on...
Amos
AmosOP4w ago
I also still have the error with suspend being required? https://github.com/amosbastian/mastra-reproduction/tree/package
Amos
AmosOP4w ago
No description
Amos
AmosOP4w ago
can get rid of it by doing
suspend: () => Promise.resolve()
suspend: () => Promise.resolve()
but it's weird also another type error with the agents and runtimeContext
Amos
AmosOP4w ago
wasn't happening before either
No description
Amos
AmosOP4w ago
it's fine to type it like
{ runtimeContext }: { runtimeContext: RuntimeContext<unknown> }
{ runtimeContext }: { runtimeContext: RuntimeContext<unknown> }
not sure why it was changed to any
_roamin_
_roamin_4w ago
Hmm, these type errors are weird, are you able to share a small repro example?
Amos
AmosOP4w ago
GitHub
GitHub - amosbastian/mastra-reproduction at package
Contribute to amosbastian/mastra-reproduction development by creating an account on GitHub.

Did you find this page helpful?