Page 1 of 1
node.js debugger setup
Posted: Tue Sep 27, 2022 6:04 pm
by noahberkley
Is there a video or guide on how to set up visual studio code debugging with Switch scripts?
Thanks
Re: node.js debugger setup
Posted: Fri Sep 30, 2022 3:29 pm
by foxpalace
Re: node.js debugger setup
Posted: Tue Oct 04, 2022 8:35 am
by freddyp
Thanks for the video!
There is one thing extra that should be mentioned: this very easy method (it is all pre-configured) is available when you work with script folders. You can use the SwitchScriptTool for that, or you can right click on a "Script element" and create the script folder from there. Extra remark: the use of TypeScript is heavily recommended.
Re: node.js debugger setup
Posted: Tue Nov 29, 2022 10:47 pm
by noahberkley
Thank you both!
Re: node.js debugger setup
Posted: Thu Sep 12, 2024 10:54 pm
by cstevens
I think something got messed up with my attach configuration, none of the variables appear and the debugger doesn't hit any of my break points. I re-watched all the learning path videos, but nothing goes into detail on how this should be configured. This used to work, but I think I developed the script package in a previous version of Switch and now it's not working.
I'm running Switch 2023 Fall.
This is what my launch.json looks like:
Code: Select all
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Attach",
"port": 9229,
"request": "attach",
"skipFiles": [
"<node_internals>/**"
],
"type": "node"
}
]
}
Re: node.js debugger setup
Posted: Thu Sep 12, 2024 10:57 pm
by cstevens
Also I see my switch-scripting module is a bit out of date:
Code: Select all
"node_modules/@types/switch-scripting": {
"version": "22.1.0",
"resolved": "https://github.com/enfocus-switch/types-switch-scripting/archive/22.1.0.tar.gz",
"integrity": "sha512-tZ3xqi1OByOGYmqX6ymjYa6Vw2Q/KhbPeiE4bJflo+/L5kT0jF1hS3dSNt6Fa1/2TplqNPhjLbnv/UE0LVSbyw==",
"dev": true,
"license": "UNLICENSED"
},
Does that matter?
Re: node.js debugger setup
Posted: Mon Sep 16, 2024 8:28 pm
by freddyp
A common mistake is not being in the correct folder in VSC when attaching. You should have the script folder open at the level of the main.ts. One level too high, one level too low and you do not see the right things.