Why can't I use my imported Three.js scripts?


see the errors in the console:

‘Cross-Origin Read Blocking (CORB) blocked cross-origin response https://github.com/mrdoob/three.js/blob/7e0a78beb9317e580d7fa4da9b5b12be051c6feb/examples/jsm/libs/stats.module.js with MIME type text/html. See https://www.chromestatus.com/feature/5629709824032768 for more details.’

and thereafter the objects I’m trying to import from those scripts I get:
‘(index):100 Uncaught ReferenceError: GeometryUtils is not defined’

I simply used this code example of three.js:


and replaced the sources with the official github links

You are not really loading js files, as you can see when you click on the link:

Besides, you can’t load ES6 module files via the script tag. You have to use import statements instead.

Demo: https://jsfiddle.net/j7nL9vfr/

1 Like

good to know, thank you very much :+1: