Skip to content

fix(ai): Use custom fetch if provided #6787

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

Merged
merged 2 commits into from
Jun 18, 2025
Merged

Conversation

zhm
Copy link
Contributor

@zhm zhm commented Jun 18, 2025

Background

Fixes a bug where fetch was not used and it always called the global fetch. This was introduced in #6746

Summary

Call this.fetch() instead of fetch()

Verification

I verified in a patched package locally.

@zhm zhm changed the title Use custom fetch parameter if it's passed fix(ai): Use custom fetch if provided Jun 18, 2025
@lgrammel lgrammel merged commit f2b041e into vercel:v5 Jun 18, 2025
8 of 9 checks passed
lgrammel added a commit that referenced this pull request Jun 19, 2025
## Background

`useChat` threw an invalid invocation error.

## Summary

Invoke fetch without `this` arg.

## Verification

Test next-openai manually.

## Related Issues

Caused by #6787
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

Successfully merging this pull request may close these issues.

2 participants