Skip to content

ERR_CONTENT_DECODING_FAILED for WebGL Brotli-compressed .data.br when patched with USSR v1.1.8 #31

@scozirge

Description

@scozirge

Version

  • USSR-v1.1.8-net6.0-win-x64.zip
  • Unity 2022.3.46f1

Environment

  • Browser: Chrome (latest)
  • Hosting: Google Cloud Storage (using gsutil setmeta to set Content-Encoding: br and correct Content-Type headers)

Steps to reproduce

  1. In Unity, enable Publishing Settings → Compression Format → Brotli and build a WebGL project.
  2. Locate the generated Build_WebGL.data.br.
  3. Run USSR, choose Remove Unity Splash Screen, and select that .data.br file.
  4. USSR creates a backup and patches the .data.br in place.
  5. Upload the entire Build/ folder to GCS
  6. Open index.html in Chrome.

Actual result

  • Chrome fails to load the patched file and reports:

The Error Shows Below:

GET https://xxxxxxxxx/xxxxxxxxxx/Build/acc473b6569bcfad667f680b1f9092b0.data.br net::ERR_CONTENT_DECODING_FAILED 200 (OK)
u @ bb0d9ecdb05db3e84da20bd14a4f84dc.loader.js:1
(anonymous) @ bb0d9ecdb05db3e84da20bd14a4f84dc.loader.js:1
Promise.then
l.cachedFetch @ bb0d9ecdb05db3e84da20bd14a4f84dc.loader.js:1
T @ bb0d9ecdb05db3e84da20bd14a4f84dc.loader.js:1
(anonymous) @ bb0d9ecdb05db3e84da20bd14a4f84dc.loader.js:1
createUnityInstance @ bb0d9ecdb05db3e84da20bd14a4f84dc.loader.js:1
script.onload @ index.html:107
script
(anonymous) @ index.html:104Understand this error
bb0d9ecdb05db3e84da20bd14a4f84dc.loader.js:1 [UnityCache] Failed to load 'https://xxxxxxxx/xxxxxxx/Build/acc473b6569bcfad667f680b1f9092b0.data.br' from indexedDB cache due to the error: TypeError: network error
bb0d9ecdb05db3e84da20bd14a4f84dc.loader.js:1

GET https://xxxxxxxxx/xxxxxx/Build/acc473b6569bcfad667f680b1f9092b0.data.br net::ERR_CONTENT_DECODING_FAILED 200 (OK)
l.fetchWithProgress @ bb0d9ecdb05db3e84da20bd14a4f84dc.loader.js:1
(anonymous) @ bb0d9ecdb05db3e84da20bd14a4f84dc.loader.js:1
Promise.catch
l.cachedFetch @ bb0d9ecdb05db3e84da20bd14a4f84dc.loader.js:1
T @ bb0d9ecdb05db3e84da20bd14a4f84dc.loader.js:1
(anonymous) @ bb0d9ecdb05db3e84da20bd14a4f84dc.loader.js:1
createUnityInstance @ bb0d9ecdb05db3e84da20bd14a4f84dc.loader.js:1
script.onload @ index.html:107
script
(anonymous) @ index.html:104Understand this error
bb0d9ecdb05db3e84da20bd14a4f84dc.loader.js:1 Failed to download file Build/acc473b6569bcfad667f680b1f9092b0.data.br
(anonymous) @ bb0d9ecdb05db3e84da20bd14a4f84dc.loader.js:1
Promise.catch
T @ bb0d9ecdb05db3e84da20bd14a4f84dc.loader.js:1
(anonymous) @ bb0d9ecdb05db3e84da20bd14a4f84dc.loader.js:1
createUnityInstance @ bb0d9ecdb05db3e84da20bd14a4f84dc.loader.js:1
script.onload @ index.html:107
script
(anonymous) @ index.html:104Understand this error
a4d522e9144b721a40631eec1f74db9b.framework.js.br:10 navigator.mediaDevices support available
bb0d9ecdb05db3e84da20bd14a4f84dc.loader.js:1 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'buffer')
at bb0d9ecdb05db3e84da20bd14a4f84dc.loader.js:1:8941

Additional Notes:
If I disable Brotli compression in Unity and patch the uncompressed *.data file, then manually re-compress with brotli --best, the file loads correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions