Run in browser not working

When I click the “run in browser” button all I get is a command prompt that opens and closes (too quickly for seeing what is being displayed, tho I’ll try and get a screenshot later) and nothing else happens. No browser opens nor any error is reported in the console.

Any thoughts?

Please:

  1. start a console
  2. cd to the project location
  3. run cocos run -p web in console

and tell me the result.

thank you!

That works just fine. But if I press the button in the IDE, that doesn’t work.

I have the same problem. Runs fine in console also. Error message in phyton: “Running command: compile. Can’t find config file .cocos-project.json in path C:\Users\Dominik\Documents\Workspace” Although my workspace is in a different folder. Seems like a bug? I tried the default workspace, then it works fine. So seems like you can’t use a different workspace or I did something wrongly.

OK, there were a few things that were wrong:

I had carried over my .cocos-project.json file over from an older version of cocos2d-js v3. It only contained the following:
{ "has_native": true, "project_type": "js" }
And by a mistake of another text editor I was using, the file was being saved UTF-8 encoded (but windows command prompt needs them to be in ANSI encoding).

Now, if you generate a new JS project with Cocos Code IDE, your .cocos-project.json will look like this:

{
"project_type": "javascript",

"debugMode" : 1,
"showFPS" : true,
"frameRate" : 60,
"id" : "gameCanvas",
"renderMode" : 2,
"engineDir":"frameworks/cocos2d-html5",

"modules" : ["menus"],

"jsList" : [
    "src/resource.js",
    "src/app.js"
]
}

However, this will NOT work! The cocos run -p web command will say that “javascript” is not a valid parameter. Lastly, if you change that "project_type": "javascript", to "project_type": "js", it does work!

So I guess I should create an issue to report this…

I’ve used a different workspace than the default and it works!