JSCAD User Group

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. Mark Hahn
    3. Posts
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 3
    • Best 2
    • Controversial 0
    • Groups 0

    Posts made by Mark Hahn

    • RE: debug jscode cli with vscode

      I should add the steps needed to use vscode to debug.

      1. Clone the jscad cli repo
      2. Do an npm install
      3. Create a standard launch profile for node.

      Here is my launch.json file ...

       "version": "0.2.0",
        "configurations": [
      
          {
            "type": "pwa-node",
            "request": "launch",
            "name": "Launch Program",
            "skipFiles": [
              "<node_internals>/**"
            ],
            "program": "node_modules/@jscad/cli/cli.js",
            "args": ["text-gen.js"]
          }
        ]
      }
      

      After this I just set a breakpoint in my jscode and launched the debugger. Worked great.

      P.S. If anyone is curious I was able to fix my vectorChar problem. It was in my code but I was only able to find my problem by using the debugger.

      posted in General Discussions
      Mark Hahn
      Mark Hahn
    • RE: debug jscode cli with vscode

      I found the answer to my problem right after posting this. I tried forever to figure this out before posting. This seems to happen to me a lot.

      For lurkers: The "program" option in the launch file should be "node_modules/@jscad/cli/cli.js"

      posted in General Discussions
      Mark Hahn
      Mark Hahn
    • debug jscode cli with vscode

      I created a project based on the example cli at Install the CLI as Part of a Project. My jscad code works and creates the same stl as using the openjscad.xyz web page.

      I'm having problems with vectorChar and I'd like to use vscode to step through the jscad cli code and debug it. I need to do this because the vectorChar code in the repo is very simple but I'm getting crazy results.

      I tried this launch.json ...

            "type": "pwa-node",
            "request": "launch",
            "name": "Launch Program",
            "skipFiles": [
              "<node_internals>/**"
            ],
            "program": "jscad"
      

      I pretty much knew it wouldn't work because jscode doesn't exist in my app's folder. Can anyone tell me what I should put in for "program" to run the jscad cli in debug mode?

      posted in General Discussions
      Mark Hahn
      Mark Hahn