How is writer.write supposed to be used?

Hey, I am trying to stream more progress data with Mastra using writer.write, but facing these issues: https://github.com/mastra-ai/mastra/issues/7782 Are there some streaming best practices or example repo I could follow?
GitHub
[BUG] On first writer.write, received Invalid state: WritableStream...
Describe the Bug I am occasionally unable to write to the stream at the start of the workflow. As indicated, I'm following the the await writer.write() pattern Adding an await new Promise((reso...
2 Replies
_roamin_
_roamin_4w ago
Hi @Ville ! The bug you linked is what is causing your issue (it hasn't been fixed yet), unless you're getting another error?
Ville
VilleOP4w ago
No it's the same issue. I thought it might be about misconfiguration too, or that there are some other best practices regarding mastra streaming. The documentation and examples of it seems a bit scattered

Did you find this page helpful?