Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some examples are broken on Firefox due to module importing #22137

Closed
sigmaxipi opened this issue Jul 15, 2021 · 5 comments
Closed

Some examples are broken on Firefox due to module importing #22137

sigmaxipi opened this issue Jul 15, 2021 · 5 comments

Comments

@sigmaxipi
Copy link
Contributor

Some 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?

#21322 by @sunag and 66bd94b 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

sigmaxipi pushed a commit to sigmaxipi/three.js that referenced this issue Jul 15, 2021
mrdoob#22137

Some examples are broken on FF. This change makes them less broken.
webgl_materials_standard_nodes.html works in FF again. The WebGPU
examples don't work in FF, but they get further along.

Tested:
 * Chrome Canary with `--enable-unsafe-webgpu`.
 * FF Public.
@gkjohnson
Copy link
Collaborator

See mrdoob's comment here.

@sigmaxipi
Copy link
Contributor Author

What about webgl_materials_standard_nodes.html?

@Mugen87
Copy link
Collaborator

Mugen87 commented Jul 15, 2021

webgl_materials_standard_nodes uses the new node material system similar to the WebGPU examples and thus import maps.

@sedubois
Copy link

Can this be solved by a shim as Rails does?

@mrdoob
Copy link
Owner

mrdoob commented Jan 19, 2022

@sedubois This has been solved already: #23163

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants