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

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

Open
1 of 3 tasks
z-zeechung opened this issue Feb 15, 2025 · 1 comment
Open
1 of 3 tasks
Labels

Comments

@z-zeechung
Copy link

z-zeechung commented Feb 15, 2025

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

npm --version
10.1.0

node --version
v20.9.0

Platforms Affected

  • iOS
  • 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

@yannikmesserli
Copy link

Yes, it does (at least on the web). It's apparently a limitation on mobile platform: Note: On Android and iOS, data can only be a string or a JSON.. Is that true? Or, it's due to the difficulty to stream data from javascript to the native code?

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

No branches or pull requests

2 participants