miurla / morphic

An AI-powered search engine with a generative UI
https://morphic.sh
Apache License 2.0
4.97k stars 1.16k forks source link

[BUG] SyntaxError: Unexpected token < in JSON during AI SDK usage after update #246

Open cyber-bytezz opened 1 week ago

cyber-bytezz commented 1 week ago

Is there an existing issue for this?

Current Behavior

I am experiencing a JSON parsing error when using the AI SDK. The error message is: SyntaxError: Unexpected token < in JSON at position 0.

Expected Behavior

The JSON parsing should work correctly without any errors, allowing smooth operation of the SDK functions.

Steps To Reproduce

In this environment: [local machine] With this config: [Provide any configuration details relevant to the SDK usage] Run the following code snippet:

fetch('https://api.example.com/endpoint')
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error('Error:', error));

Environment

SDK Version
Node.js Version

Anything else?

No response