Ask coding questions

← Back to all posts
Can't use import statement outside of a module, but I don't know what that means [Three.js]
angrydoge

Hello!

i'm making a new Three.js scene, and I haven't made a Three.js scene in a long time. I'm getting this error:

Can anyone help me with this? Thanks in advance.

Answered by ch1ck3n [earned 5 cycles]
View Answer
Voters
angrydoge
Comments
hotnewtop
ch1ck3n

it has to be like this i think:

<script src="script.js" type="module"></script>

angrydoge

@ch1ck3n thank you