[SOLVED] Window.location is undefined BUG

Hi,

I am working with cocos creator v.1.1.1. The project was running properly both in simulator and browser modes, but now the simulator doesn’t run the game and the console shows this error:

Simulator : Evaluating src/project.dev.js failed (evaluatedOK == JS_FALSE)
Simulator : 133:TypeError: window.location is undefined at a ( … \library\bundle.project.js?009:NaN:0):
Simulator : ScriptingCore::callFunctionName error:__errorHandler wasn’t found!
Simulator : Evaluating main.js failed (evaluatedOK == JS_FALSE)
Simulator : iShow!

The browser mode continue working properly. How can I fix this problem?

Thanks

Regards

There is no window.location in simulator, in native environment, only pure Javascript API is supported, window.location is DOM API which is provided by browser layout engine, not by Javascript engine.

Equally, there is no url location for a native application neither

So then… why the console shows this error? I am very confused. I added an external JS lib to the project:

Maybe this was the source of the problem. I have deleted this script from the project but the issue remains

OK, the problem is the external library. I need to load it only for the browser version. I will try to use SDKBOX for mobile versions

Thanks!