Skip to content

Angular Zones break promises in openai package (return null)Β #53380

@rattrayalex

Description

@rattrayalex

Which @angular/* package(s) are the source of the bug?

zone.js

Is this a regression?

No

Description

Users making requests with the openai package while using Zones receive null on all requests.

Eg;

const response = await this.openai!.chat.completions.create({
  model: 'gpt-3.5-turbo',
  messages: [
    {role: "system", content: "Explain me the purpose of life"},
  ],
});
// response === null, but shouldn't be

Users report that upgrading zone.js to ^0.14.2 allows things to work with .then(), but not with await.

This is likely related to the openai package subclassing Promise to add helper methods, like .asResponse().

Please provide a link to a minimal reproduction of the bug

openai/openai-node#232 (comment)

Please provide the exception or error you saw

completion is `null`

Please provide the environment you discovered this bug in (run ng version)

I am a maintainer of `openai`, not an Angular user. Users have reported this with Angular v17 (and earlier) and [email protected] (and earlier).

Anything else?

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions