When use @google/genai, I got an "Illegal invocation" error
I wrote a Next.js application, deployed on Cloudflare Pages. And I use @google/genai to do some AI jobs. It works well on my local dev environments.
But it cannot work on Pages, I got 500 error, which is "TypeError: Illegal invocation: function called with incorrect this reference" actually.
My code is so simple that I don't think the problem is in my code.
Does anyone know how to resolve it? Is there a way to workaround it? Please give me some help, thank you all.
0 Replies