As the error message says you are trying to use ES6 import syntax outside of a module context. This usually happens when you import modules within ordinary <script> tags. It only works if you add the attribute type="module" similar to the official three.js examples.