I have a good idea of why you could be having this problem. You are using node right? what server are you using to serve it? Express? my guess is that youre not serving node_modules in you public_dirrname.
Problems with ES6 Imports in threejs using node 14? (No Webpack or Babel) if so, take a look at this page.