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!