Unfortunately it seems that while 0.137.1 fixes the issue in some cases, it doesn’t for others - right now we can’t get vite to resolve ‘three/examples/…’ into anything. Not sure how/where/if to add an importmap there, in index.html didn’t work.
Please clarify if the issue is related to vite or three.js. If you think vite is not the cause of your problem, please open an issue at the three.js GitHub repo.
I simply don’t know yet. Three has switched to this system but in contrast to before there’s absolutely no docs on how to get this to work in build systems, besides how to use import maps in plain HTML (not in a build system). That’s what I was pointing out here as many others seem to be taken by that change by surprise as well and I hope to learn how to resolve this.
I can only say that there’s not enough docs and that right now we can’t get package references to a local copy of R137 to work in build systems at all (which was working great before this change).
Not sure if this is related, but when using r137 along with three-stdlib and bundling typescript with webpack + ts-loader, I’m seeing a warning in the console that says “WARNING: Multiple instances of Three.js being imported.”
git bisecting three alongside my minimal repro repo (linked in the above issue) points to this commit from PR23315 as the first time ts-loader has issues.
Don’t mean to derail this thread (it was the first result when I searched) so happy to make a new question if warranted.