Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section



Column
width50%


Note
titleBefore you start!
The first step is to install Profound.js onto your local machine by using 'npm install profoundjs'. Click here for more detailed installation instructions.



Column
width50%


Info
titlePlease note...
You can and are welcome to use any Node.js debugger you prefer with Profound.js; however, this walk-through illustrates using VS Code, as it is one of the more popular, free, and easy to use debuggers for Node.



...

2. Navigate to the ‘Run and Debug’ tab.

Image RemovedImage Added

3. Click on the ‘create a launch.json file. This will open a new launch.json file with no configurations just yet on your directory.

...

6. When your debugger starts running, you should see the following in your ‘DEBUG CONSOLE’:

Image RemovedImage Added

7. Once you have your Profound.js server running from VS Code, that means you are now able to debug.

...

  1. In the VS Code explorer, open 'modules/pjssamples/connect4.js'

Image RemovedImage Added

*Note: make sure your Profound.js Module has been set correctly in the config.js file of Profound.js. Here is an example: 

Image RemovedImage Added

2. Once the file is open, place a breakpoint at the desired location where you want the program to pause.

    You can place a breakpoint by clicking just to the left of the line number where you intend to pause the program.

Image RemovedImage Added

3. After this, start debugging within VS Code and launch the application in your browser using the URL displayed in the debug console.

...

You can also add the -brk and --no-worker flag for this command. -brk adds a breakpoint at the beginning of your script to wait for the debugger to attach before proceeding.

2. Then create a launch.json file, refer to the Launch config method for steps on how to do this.

Code Block
titlelaunch.json
{
  "version": "0.2.0",
  "configurations": [
    
      {
        "request": "attach",
        "name": "Debug PJS",
        "address": "21.1.88.92",
        "port": 40399,
        "remoteRoot": "/nmas_pjs",
        "localRoot": "C:\\Documents\\nmas_pjs",
        "type": "node",
        "skipFiles": [
          "<node_internals>/**"
        ]
      }
  ]
}

...