ionic-team / ionic-team/capacitor

[Bug]: CapacitorHttp seems block stream response until it's finished?

Open
#7,890 1 comment 1 reaction 0 assignees View on GitHub
triage
Dominant language
TypeScript
Stars
16.7k
Forks
1.3k
Avg merge
3d 15h
Merged PRs (30d)
10

Description

### Capacitor Version

Capacitor Doctor

Latest Dependencies:

@capacitor/cli: 7.0.1
@capacitor/core: 7.0.1
@capacitor/android: 7.0.1
@capacitor/ios: 7.0.1

Installed Dependencies:

@capacitor/ios: not installed
@capacitor/core: 6.1.2
@capacitor/android: 6.1.2
@capacitor/cli: 6.1.2

[success] Android looking great! 👌

### Other API Details

```Shell
npm --version
10.1.0

node --version
v20.9.0
```

### Platforms Affected

- [ ] iOS
- [x] Android
- [ ] Web

### Current Behavior

I am currently working on an AI APP which invokes LLMs from web directly. To bypass CORS restriction, I use CapacitorHttp. The CapacitorHttp seems blocks all stream response before they finish. I have reproduced this problem in a minimum program.

### Expected Behavior

The stream response should be returned chunk by chunk

### Project Reproduction

https://github.com/z-zeechung/nnchat-capacitor-http-stream-bug-reproduce

### Additional Information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.