Skip to content

Dead yuv.js reference in non-WebGL fallback path #20

Description

@rophy

Summary

globals.js:66 references new Worker("./yuv.js") as a fallback when WebGL is unavailable, but yuv.js and yuv.wasm were removed from the repo and build output.

Details

The video rendering path in flutter/web/js/src/globals.js has two branches:

if (YUVCanvas.WebGLFrameSink.isAvailable()) {
  // WebGL path — works
} else {
  yuvWorker = new Worker("./yuv.js");  // fallback — 404
}

yuv.js was moved to flutter/web/v1/ in commit 41a20b5, then v1/ was deleted. The reference was never updated.

Impact

Low — WebGL is available in all modern browsers including headless Chromium (verified locally). This fallback path is effectively dead code. The test setup in globals.setup.ts mocks isAvailable() to return false, which would hit this path in unit tests but doesn't cause a runtime failure since Worker isn't instantiated in that context.

Suggested fix

Remove the dead non-WebGL branch entirely, or add an explicit error message if WebGL is truly unavailable.

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