Git Product home page Git Product logo

Comments (6)

bendvc avatar bendvc commented on August 29, 2024

Hi @Mohansharu

If you intention is to debug server-side code using VSCode, then the following launch.json configuration seems to work for me.

{
    // 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": [
        {
            "type": "node",
            "request": "launch",
            "name": "Launch Program",
            "skipFiles": [
                "<node_internals>/**"
            ],
            "runtimeExecutable": "npm",
            "windows": {
                "runtimeExecutable": "npm.cmd"
            },
            "runtimeArgs": [
                "run",
                "start:inspect"
            ]
        }
    ]
}

from pwa-kit.

Mohansharu avatar Mohansharu commented on August 29, 2024

@bendvc its not working for PWA

from pwa-kit.

vinhtrinh avatar vinhtrinh commented on August 29, 2024

Hi @Mohansharu

The debugger works fine for me on both VSCode and browsers.
Before you start the debugger, you must start the app with --inspect option: npm run start:inspect

The following are launch settings in my workspace.

{
  "launch": {
    "version": "0.2.0",
    "configurations": [{
      "name": "MRT Server",
      "port": 9229,
      "request": "attach",
      "skipFiles": [
        "<node_internals>/**"
      ],
      "type": "node"
    }, {
      "name": "PWA App",
      "request": "launch",
      "type": "chrome",
      "url": "http://localhost:3000",
      "webRoot": "${workspaceFolder}"
    }]
  }
}

If you want to debug in VSCode, you must use the attached browser (the browser window open by VSCode when start the debugger)
debug-vscode

Or if you build the app with source-map, you can debug directly in the browser.
debug-browser

from pwa-kit.

bendvc avatar bendvc commented on August 29, 2024

@Mohansharu I was able to get it working with the same config that you have. Uninstalled my debugger extension in VSCode and reinstalled it using the nightly version --> https://marketplace.visualstudio.com/items?itemName=ms-vscode.js-debug-nightly

Screen.Recording.2024-01-23.at.11.26.26.AM.mov

from pwa-kit.

bendvc avatar bendvc commented on August 29, 2024

It looks like we have confirmation that debugging in vscode is possible for both server and client. For that reason I'll be closing this issue.

from pwa-kit.

Mohansharu avatar Mohansharu commented on August 29, 2024

Hi @bendvc

I have copy pasted your launch.json file when click on debug it showing this error in debug console

image

from pwa-kit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.