Importing & using AssistantStream breaks Angular SSR
Problem
Confirm this is a Node library issue and not an underlying OpenAI API issue - [X] This is an issue with the Node library Describe the bug Just by adding the following lines in my new Angular project, I get an error. Lines: [code block] On compiling the code I get the following error: [code block] Now I'm unsure whether or not this is something you guys can fix, or it should be somehow reported to Angular or the polyfill... but I thought I'd start here, because I really have no clue what's going on. The internals of the AssistantStream are somewhat beyond me and I have no experience with handling streams in Typescript. Feel free to close this issue and report it to the right place - or I can do it with the right info. To Reproduce 1. Install Angular normally with [code block] As part of the installation prompts, choose to use SSR 2. Add this lib [code block] 3. Change the app.component.ts to include the openai AssistantStream [code block] 4. Run angular and watch it crash [code block] Code snippets [code block] OS Linux Mint Node version 20.9.0 and 22.1.0 Library version 4.51.0
Error Output
Error when evaluating SSR module /main.server.mjs:
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Importing & using AssistantStream breaks Angular SSR
@Jsuppers could you try the v5 beta? I suspect it may fix this issue implicitly https://community.openai.com/t/your-feedback-requested-node-js-sdk-5-0-0-alpha/1063774
Trust Score
2 verifications
- 1
@Jsuppers could you try the v5 beta? I suspect it may fix this issue implicitly
@Jsuppers could you try the v5 beta? I suspect it may fix this issue implicitly https://community.openai.com/t/your-feedback-requested-node-js-sdk-5-0-0-alpha/1063774
Validation
Resolved in openai/openai-node GitHub issue #896. Community reactions: 1 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep