Some examples are broken on Firefox due to module importing
See original GitHub issueSome examples and example libraries use import * as THREE from 'three';
which not supported on Firefox. This results in the error Uncaught TypeError: Error resolving module specifier “three”. Relative module specifiers must start with “./”, “../” or “/”.
on certain example pages such as https://threejs.org/examples/webgl_materials_standard_nodes.html and all the 7 webgpu_*
examples.
I was able to fix this locally by switching to import * as THREE from '../build/three.module.js';
but this needs to be done for the example html files and also a bunch of JS like jsm/renderers/nodes/inputs/ColorNode.js
.
The WebGPU examples are broken on FF Nightly for other reasons (I think FF is using an old version of the API but I’m not sure), so it might be OK to leave those with import maps for now. But should https://threejs.org/examples/webgl_materials_standard_nodes.html be fixed to keep FF support?
https://github.com/mrdoob/three.js/pull/21322 by @sunag and https://github.com/mrdoob/three.js/commit/66bd94b5ca1fc24e508d69342f737355eeb5e9d4 by @mrdoob are the problematic changes.
Broken browsers: FF public version 89.0 FF nightly version 92.0
Working browsers: Chrome
Three.js version: dev and 130
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
webgl_materials_standard_nodes
uses the new node material system similar to the WebGPU examples and thus import maps.See mrdoob’s comment here.