Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AnthropicStream decoding broken: SyntaxError: Unexpected end of JSON input. From chunk: [ 'event: content_block_delta' ] #1159

Closed
baptisteArno opened this issue Mar 15, 2024 · 4 comments
Assignees

Comments

@baptisteArno
Copy link

Description

To reproduce:

  • Deploy next-anthropic example
  • Type any prompt

CleanShot 2024-03-15 at 08 57 22

On the server, it shows this error: SyntaxError: Unexpected end of JSON input. From chunk: [ 'event: content_block_delta' ]

Code example

No response

Additional context

No response

@lgrammel
Copy link
Collaborator

Which anthropic SDK version are you using? Is this an issue with v0.18.0?

@lgrammel lgrammel self-assigned this Mar 15, 2024
@baptisteArno
Copy link
Author

I tried latest, and it also happens with the same versions as the example.

This bug seems to only happen when deployed on Vercel. I could not reproduce locally 🤦‍♂️

Just deploy the next-anthropic example, you should see the issue as is.

@lgrammel
Copy link
Collaborator

Related: #1173

It worked for me on Vercel with v0.18.0

@baptisteArno
Copy link
Author

Confirmed! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants