Debugging using VSCode

Hi @:cactus: needle admin ! How would I go about “attaching” VSCode to the browser running my local sample? (Auto-installed server via Unity)

I started tinkering around with existing components and now I want to do some exploration of the typescript codebase but without a proper debugger that’s kind of hard :slightly_smiling_face:

Original Post on Discord

by user 395602247196737546

I havent tried that with the engine or any js clientside package yet to be honest :thinking: Only nodejs (and all other languages I’ve worked with) - so good question. I don’t have an immediate answer for you

Perhaps this helps? node.js - vscode debug code in node_modules directory - Stack Overflow

Oh ok. Then what is your workflow for debugging your ts components?

by user 395602247196737546

Console.log + breakpoints in the browser (chrome) when necessary

Ok it seems you just need to modify the launch.json to match vite’s url. In the default case:
"url": "https://localhost:3000",

With this I can now set and trigger breakpoints, at least in engine code. Custom components I haven’t touched so far.

by user 395602247196737546