Can't load models on Linux/macOS, but windows works fine

I’m trying to load models on Linux/macOS, but I get an error. I can’t seem to find any answers as to why it is happening. It works absolutely fine on windows though.
Here is image of the error:


I am running a nw.js application, if that matters.
Anyone know why this is occurring, and more importantly, how I would fix it?

hm… I just randomly managed to figure it out!
I have to add ‘file://’ in front of the path on Linux/macOS.
loader.setPath( 'file://'+directory );