Error ENOENT no such file or directory

While my project works perfectly fine on one computer (Windows PC), I get this error (in Unity console) on another (MacBook) when trying to play locally.
Error: ENOENT: no such file or directory, open [project path]/node_modules/three/addons/objects/[files I'm referencing].js
Those are files I’m referencing from some of my custom components. Such as addons/geometries/DecalGeometry.js.
What’s odd is that I can’t even find those files on the computer that it works on.
Any idea?

Original Post on Discord

by user 732122195614105653

That’s strange. Can you try if this persists after clicking ā€œClean Installā€? (hold ALT and press Install on the ExportInfo)

Hey @herbst🌵 Happy New Year!
So, to answer your question, yes it does happen even when I do a clean Install.
Not how relevant this is, but this is happening on a Mac, while it works on a Windows computer.

by user 732122195614105653

More info:
I found that while three/addons works on my Windows PC, on the Mac I need to change this to three/examples/jsm```` Windows: import { DecalGeometry } from ā€˜three/addons/geometries/DecalGeometry.js’;Mac:import { DecalGeometry } from ā€˜three/examples/jsm/geometries/DecalGeometry.js’;```

by user 732122195614105653

Happy new year to you too, thanks for following up!
So I think ā€œthree/addonsā€ is an alias for "examples/jsm used in some cases, ā€œthree/examples/jsmā€ is the actual path.
But you can always remap those with import maps - it definitely shouldn’t be necessary to do that differently for different OS’s, would love to learn more about that on your end.

So indeed, three/examples/jsm works on Windows too. I’ll just keep in mind not to use the alias then.

by user 732122195614105653

I think if you have importmaps in your index.html (or path remaps in the vite.config.js) then either does work, there’s no automagic aliasing of these names I believe

But good to know the regular way works for you now!