[Possible BUG] Problem with Safari browser

I am using Cocos2D JS 3.13.1 to create a game. The game runs smoothly on all web browsers except Safari on Mac OS, where it does not even load. Failing to see the problem with my game I decided to test a complete new game created using cocos command. To my surprise the new game also failed to load on Safari.

Steps to produce the problem:

  1. Run the cocos command to create a new game

$ cocos new MyGame -p com.cocos.mygame -l js -d /ProjectFolder

  1. Run the index.html file on Safari on Mac OS.

Help please.

try 3.14.1 please.

It happens with 3.14.1 as well. Safari does not work.

Here is a screen shot of the problem.

@zhangxm @pandamicro

I opened an issue on GitHub.

Can anyone give a solution?

I have asked the engineering team to look at this thread. Does this work in Firefox or Chrome?

Yes it works perfectly fine on all other browsers.

There is possibly something wrong with your project.json data, please log the txt and data value at line CCBoot.js:2592, to see whether the txt loaded is correct and whether it could be correctly parsed.

I did not change anything in project.json. In fact I did not change anything anywhere.

I just created a new game using the cocos command and then opened the index.html in Safari.

I really need a solution to this problem.

Try with cmd prompt cocos run -p web -b [browser-path]
For more details http://cocos2d-x.org/docs/editors_and_tools/cocosCLTool/

1 Like

Great it works! I ran the following command

$ cocos run -p web -b /Applications/Safari.app

But how do I compile a release version that runs on Safari? I tried the following command but the output does not run on Safari.

$ cocos compile -p web -b /Applications/Safari.app -m release

Thanks for your help. I greatly appreciate it.

I really dont know as I am C++ dev. I just started with JS.
But few days back i ran this command cocos compile -p web -m release --advanced
After that publish folder will be generated and i uploaded into my server and its working fine in chrome as well as in safari. :slight_smile:

@smitpatel88 wow this is great info!