-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
"body stream already read" error due to broken blazor wasm fallback #40547
Comments
An issue where this manifested - #40528 |
cc @pranavkm |
Seems that the underlying issue is the OOM happening. I'm closing this issue in favor of #40547 |
Re-opening as dotnet/runtime#95971 is more related to changing the error message. |
Thanks for contacting us. We're moving this issue to the |
@danroth27 @SteveSandersonMS This to me seems huge and would make my clients rethink any investment in Blazor. Is there any way this could be looked into for an earlier release than next nov? |
@CoryKoehler I suspect this issue isn't your actual problem, and that dotnet/runtime#95971 is. We have an ongoing discussion with the runtime team and will post updates there. |
@SteveSandersonMS thank you so much. I have been trying to keep track of all the related issues across repositories that seem to be related to this. That is helpful to start getting an idea of where you all are at. Would it be helpful or noise for me to put my above comment into that issue? |
I'm going to close this out in favor of #42055. |
Right now if a streaming compile of the blazor wasm binary fails, we fall into a fallback path that won't actually work. It produces this error:
TypeError: Failed to execute 'arrayBuffer' on 'Response': body stream already read
This is because the first compile attempt already consumed the body of the response, and it can't be consumed a second time. The fix is to issue a second fetch before attempting to compile again. We would want to do that in the fallback path above here:
aspnetcore/src/Components/Web.JS/src/Platform/Mono/MonoPlatform.ts
Line 646 in 98641b0
We also currently just try to do a streaming compile, but the most common failure case is detectable without trying to compile - if the content-type of the response is not
application/wasm
the streaming compile will always fail, so we should probe for that (viaresponse.headers.get("Content-Type")
) and if it doesn't match we should just immediately jump to the fallback. This would eliminate the need for a 2nd fetch.(The second fetch shouldn't be a performance issue anyway, it should hit the browser cache.)
cc @radical
The text was updated successfully, but these errors were encountered: