Skip to content

fix: replace Axios responseType stream with native fetch for browser compatibility - #19

Merged
Senthil455 merged 1 commit into
mainfrom
fix/copilot-stream-browser-fetch
Jun 15, 2026
Merged

fix: replace Axios responseType stream with native fetch for browser compatibility#19
Senthil455 merged 1 commit into
mainfrom
fix/copilot-stream-browser-fetch

Conversation

@Senthil455

Copy link
Copy Markdown
Owner

Problem

copilotApi.chat.stream() used api.post(..., { responseType: "stream" }) which is an Axios feature only available in Node.js. In browser environments, Axios does not support responseType: "stream" — the call would silently fail or throw.

Solution

Replaced the Axios call with native fetch() that returns a Promise. The response body provides a ReadableStream via response.body.getReader() which is the standard browser API for consuming streaming responses.

The Authorization header is set from the in-memory token (via getAccessToken()), consistent with the rest of the API layer.

@Senthil455
Senthil455 merged commit ff85c77 into main Jun 15, 2026
0 of 9 checks passed

@Senthil455 Senthil455 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gh: Not Found (HTTP 404)
{"message":"Not Found","documentation_url":"https://docs.github.com/rest/issues/comments#get-an-issue-comment","status":"404"}

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.

1 participant