I guess moduleId is for routes and not a plain typescript class, right? Besides, I need the path of the file in the bundle and it might be different than its absolute path in the file system.
it did not work with moduleId as it is always undefined, however after talking with @jods4 on gitter, and using absolute path the problems sounds to be solved, I test it with fusebox and now I am trying to test with webpack and requireJS, to assure that it will work with either of them.
not yet, only fusebox-aurelia-loader, works fine with what @jods4 suggested. about setTimeout, I am not sure maybe in your case an instance is created and moduleId becomes valid, not sure about life cycle in js, but in my case I didn’t get event one running with moduleId not being undefined.
And another point to mention, components are Aurelia stuff, while services are not, they are plain typescript or to be precise javascript, they might not have moduleId at all; I’ll test it, however.