You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constresponse=awaitfetch(`http://xxx:port/xxx`,{method: 'POST',headers: {'Content-Type': 'application/json','Accept': 'text/event-stream',},body: {/* Some body */},});if(!response.body){thrownewError('No response body');}constreader=response.body.getReader();constdecoder=newTextDecoder();while(true){const{done, value}=awaitreader.read();if(done)break;constchunk=decoder.decode(value);constlines=chunk.split('\n');for(constlineoflines){if(line.startsWith('data: ')){constdata=line.slice(6).trim();if(data==='[DONE]'){console.log('Stream completed');break;}elseif(data){console.log('Received chunk:',data);}}}}
With the same code, when I use the browser's native fetch, it runs normally and outputs results in a streaming manner. However, when using Tauri's plugin-http, it blocks until the server outputs all content and then outputs everything at once, which means it blocks at const = await fetch()
Describe the bug
Here is demo:
With the same code, when I use the browser's native fetch, it runs normally and outputs results in a streaming manner. However, when using Tauri's plugin-http, it blocks until the server outputs all content and then outputs everything at once, which means it blocks at
const = await fetch()
Reproduction
No response
Expected behavior
No response
Full
tauri info
outputStack trace
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: