Problems with ES6 Imports in threejs using node 14? (No Webpack or Babel)

I may be completely lost here - but if you are using node, you can’t get an HTTP error like 404 Not Found. Node isn’t a server, it’s a runtime. Seems to me like you are using Express or a similar node HTTP server?

If it’s index.html that loads index.js that THEN loads three/examples/.., then server.js must either serve the entire node_modules/ (I assume it only serves what’s in public/ directory?) or you should move node_modules/threejs to public and adjust import path accordingly (to ./threejs/examples/.. or similar)

Long story short - the error seems to have nothing to do with node or ES6 imports, it’s the code inside server.js that’s causing trouble.

1 Like