I made a ts script which doesn’t extent cc.component and has a ctor function. now, I had a cc.loader.loadres closure function in the ctor function where I was reading a json file and parsing it. when I was doing this I was getting an error : Uncaught SyntaxError: Unexpected end of JSON input
when I moved the loadres to another function and called that function after instantiating the ts class, it was working fine.
I want to know why this happened.