`Reflect.get called on non-object` error when using OpenAI library in NextJS
I'm having issues in getting OpenAI library to work in NextJS project on Cloudflare Pages.
I got the following error in workers log stream when calling the API endpoint on NextJS app:
Below is the minimal code that reproduce the issue:
I tried searching around on the internet to see if anyone encounter the same issues and possible solution but I couldn't found any. Interestingly, the example from Cloudflare Docs Stream OpenAI API Responses seems to be working when I tried it.
Stream OpenAI API Responses · Cloudflare Workers docs
Documentation for Cloudflare Workers, a serverless execution environment that allows you to create entirely new applications or augment existing ones …
5 Replies
We are facing the same issue. Can anyone help? @Cloudflare (Server Owner) ?
Also facing the same issue!
+1
GitHub
🐛 Bug Report — Runtime APIs: The AsyncContext of AsynLocalStorages ...
If I define a custom thenable and try to access the store of an AsyncLocalStorage in the then method, the store seems to be undefined although it shouldn't be. Basically: import { AsyncLocalSto...
I switched to directly calling the OpenAI API instead of using the npm package, and it worked.