I have created a new project and run it in web
cocos run -p web.
I have downloaded the cocos2d extension for vscode and placed it into the exact folder.
Now when I click on debug inside of vscode , it is giving me an error :
ar: attachRequest: address: localhost port: 5086
ar: attachRequest: retry socket.connect
I have the same error as @ysrikanth2011 on Windows. I’m writing mainly in js in cocos creator and I need to bind a C++ function can you give me any advice?
@zhangxm Hm, okay, this is nice! It would be even better if the source wasn’t just the giant JS blob file; in other words, I could view and set breakpoints in my original individual source files. I’m pretty sure it is possible to resolve this using the “source maps” provided (other VSCode debuggers seem to be doing this).
The other thing that is absolutely killer: No log messages from cc.log are shown in the Debug Console in VSCode. Maybe there’s a way to pass them through?
That would be a very helpful improvement which would make life a bit easier for all of us!
@xujingfire please use english in the forum in future. About using this feature in other version, i also have not idea. As you know, there are so many differences. But you can refer to the PR and modify it yourself. Sorry about that.
Hello sir,I have a problem that my file structure like this:
frame
------{other js file}
------ script
---------- main.js
game
----- {other game js file}
if i open the folder with ‘main.js’ ,there is no other js file so i can’t debug other js file in the vscode
Did you modify the folder structure? Currently, the plugin depends on main.js to check if it is a valid project or not. And treat it as the root of the project. So please don’t move main.js to other folder.