-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Error when trying to use compression (Brotli) in Blazor WASM: "Uncaught (in promise) Corrupted padding bits " #45191
Comments
@sturlath thanks for contacting us. The repro is not accessible. |
Hi @sturlath. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
Sorry @javiercn its open now! |
@sturlath Seems like you are using a custom library to decompress the brotli stream and the error is coming from it. Could you try using the From what I can tell, it is likely an issue in the library you are using. |
@sturlath Could you please try following the approach that https://github.com/aspnet/quickgridsamples/tree/main/src/QuickGridDemos uses? Thanks. |
Hi @sturlath. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
@javiercn are you talking about the code in the decode.min.js? That code comes from your docs where it points to these files here. That is the only "custom" library I have added. Btw I just took the none-minified code and inserted it into the decode.min.js file after seeing this here But as you can see now (I just updated it) and it still has the same issue.
Any change you can point me to some code that I can work with to change the current implementation with? |
Sorry @MackinnonBuck I didn´t see your comment until now. But I found this here but can´t find any compression code... |
@sturlath can you check that the stream that you are downloading is actually Brotli compressed? Just in case there is a configuration issue on the server and is sending an uncompressed version. Can you log at least the filename/url that is causing the failure? |
Not sure how I can check the stream since I just hit errors and don´t see anything in the console. This is the url https://blazorbrotli20221120112426.azurewebsites.net I just pushed it to azure (this time) with Visual Studio (default.. no extra settings) you can see some .br files there |
@sturlath I was suggesting you put a log statement here. To see what exact file is causing problems: Maybe update the code to put it inside a try-catch and log the name/url of the resource it was trying to decode. |
@javiercn I added the logs. Does this help? Anything else I can try out? Isn´t there some Blazor WASM compression example you have I can try out and publish to see how that works out? |
@sturlath from what I can tell in your code, the problem is that it is trying to load |
@javiercn is that a server setting (I havent read anything on that) or something I can influence in code? And how? Do you know of any docs that might help? |
Looks like the issue is because the |
Thanks for contacting us. We're moving this issue to the |
@sturlath Yes, it probably is a server setting. Azure hosted apps may return 404 for unconfigured file extensions, such as |
Thank you @SteveSandersonMS! That fixed the issue with the example. It now fetches the .br files. I will now check if this fixes my original issue with my product. I´ll report back. |
Thanks for contacting us. We're moving this issue to the |
Is there an existing issue for this?
Describe the bug
I have been trying to get my Blazor WASM project to compress to avoid the 100 MB over 30-50 sec load time I´m currently having and have been trying to compress the files and serve Brotli (.br) files to my client. I have gone over the documentation and tried all I can think of (see what I have now).
I´m using the abp.io framework and thought that they were missing something but they have managed to get the same error from an file-new-Blazor-WASM-project
Expected Behavior
Blazor WASM client/browser gets served only .br files (not 100MB of .dll´s) and loads without any console errors in faster time rate than 30-50 sec
Steps To Reproduce
Here is my file-new-project-code-example (I tried min and max version of the decode.js file) and here is the code pushed to Azure.
For some reason I´m getting a different error than @realLiangshiwei is getting here

Exceptions (if any)
.NET Version
6.0.302
Anything else?
Locally I run on Windows and Visual Studio latest preview version. The app in Azure is just AppService. I have been struggling to get my Blazor WASM to perform since summer without any luck and am hoping we can figure out this compression issue.
The text was updated successfully, but these errors were encountered: