Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
Getting the following error when deploying our Blazor WASM App to an Azure Static Web App resource.
I have followed all of the documentation and also tried using both the min version of decode and the non-min version. The app runs fine locally with Brotli and the decode script. The issue appears specific to the Azure Static Web App resource since I have had no issues deploying to other servers in the past. I was unable to find much info on the issue.
Here is what is served when navigating to the app:
The script code:
<script src="_framework/blazor.webassembly.js" autostart="false"></script> <script type="module"> import { BrotliDecode } from './decode.js'; Blazor.start({ loadBootResource: function (type, name, defaultUri, integrity) { if (type !== 'dotnetjs' && location.hostname !== 'localhost' && type !== 'configuration') { return (async function () { const response = await fetch(defaultUri + '.br', { cache: 'no-cache' }); if (!response.ok) { throw new Error(response.statusText); } const originalResponseBuffer = await response.arrayBuffer(); const originalResponseArray = new Int8Array(originalResponseBuffer); const decompressedResponseArray = BrotliDecode(originalResponseArray); const contentType = type === 'dotnetwasm' ? 'application/wasm' : 'application/octet-stream'; return new Response(decompressedResponseArray, { headers: { 'content-type': contentType } }); })(); } } }); </script>
Expected Behavior
The app should load without error when using Brotli in a Blazor WASM app and deploying to an Azure Static Web App.
Steps To Reproduce
No response
Exceptions (if any)
Uncaught (in promise) Error: Corrupted padding bits
at jumpToByteBoundary (decode.js:1759:23)
at decompress (decode.js:1352:13)
at decode (decode.js:2208:13)
at (index):38:59
at async at.initAsync (blazor.webassembly.js:1:36102)
at async Object.Vt [as start] (blazor.webassembly.js:1:61895)
jumpToByteBoundary @ decode.js:1759
decompress @ decode.js:1352
decode @ decode.js:2208
(anonymous) @ (index):38
await in (anonymous) (async)
(anonymous) @ (index):28
.NET Version
7.0.4
Anything else?
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status