Repository navigation
[Extension]: Easy Dictionary AI providers fail — TextDecoderStream is not defined in the runtime #1935
Unanswered
kongkk233
asked this question in
Issue Triage
Replies: 1 comment
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Existing discussions
What happened?
Easy Dictionary's AI providers don't work. Testing an OpenAI-compatible provider in Manage Providers fails with:
Expected: the provider test succeeds and shows the translation.
The extension sends its AI requests through
@xsai/stream-text, which callsbody.pipeThrough(new TextDecoderStream()). The runtime definesTextDecoder,ReadableStream,WritableStreamandTransformStream, but notTextDecoderStream. The error is thrown on the client side after the response arrives, so it should not depend on the provider or model.What I checked:
RaycastRuntime.generated.jsfrom the 0.12.15 app bundle injsc(with a stub host) and calling the extension's bundledstreamTextgives the same error.TextDecoderStreampolyfill (aTransformStreamaroundTextDecoder) to the extension'snode_modules/@xsai/stream-text/__bundle.js. With that in place the provider test passes in Tinycast.One detail that may matter for a fix: the runtime's
TextDecoder.decodeignores{ stream: true }, and a fetch body is handed out in 65536-byte chunks. ATextDecoderStreamtherefore has to hold back an unfinished multi-byte sequence itself, otherwise CJK text breaks at chunk boundaries.The main Search Word command bundles the same module, so I expect AI translation there to be affected too. I only tried the provider test before patching.
Steps to reproduce
http://127.0.0.1:8090/v1.Screenshots or recording
No response
Tinycast version + channel
0.12.15 stable
macOS version
27.2.1
All reactions