[email protected] bundles outdated [email protected], causing LuminanceFormat SyntaxError with current Three.js
@google/[email protected] fails to load with recent Three.js versions:
Uncaught SyntaxError: The requested module 'three' does not provide an export named 'LuminanceFormat' (at model-viewer-effects.min.js:1:796)
Root cause: model-viewer-effects bundles postprocessing@^6.37.1 directly into its distributed file. LuminanceFormat was removed from Three.js's exports, and postprocessing fixed this exact issue in v6.37.3 ("Remove use of LuminanceFormat for r176 support", PR #702). Since model-viewer-effects bundles postprocessing at build time rather than resolving it live, updating the consuming project's Three.js version doesn't help — the outdated, broken code is baked into the shipped .min.js file itself.
To reproduce: Follow the official setup at https://modelviewer.dev/examples/postprocessing/ using three@^0.183.0 (or any Three.js version without LuminanceFormat) with @google/[email protected]. Confirmed reproducible with zero CDN involvement — self-hosting all three libraries locally (downloaded directly from the npm registry) produces the identical error, ruling out any CDN/caching explanation.
Ask: Please rebuild and republish model-viewer-effects against postprocessing@>=6.37.3 (or later) to pick up the fix.
Source: google/model-viewer