Skip to content

Remote debugging with custom package.json script #97

@hwride

Description

@hwride

Hi,

I have got a non-standard way of Node remote debugging worked. I'd like to ask advice on getting to work the standard way if possible.

Current approach
I am running App Service with a non-standard JS file location booted from an NPM script. E.g.

{
  "scripts": {
    "dev": "node src/main/main.js"
  }
}

I have currently got remote debugging working like this:

{
  "scripts": {
    "dev": "node src/main/main.js",
    "dev_debug": "node --inspect=0.0.0.0:11111 src/main/main.js"
  }
}

Then use AZ CLI SSH + port forwarding to get the port to my local machine. This work ok.

Other attempts
I initially had the following:

{
  "scripts": {
    "dev": "node src/main/main.js",
    "dev_debug": "node --inspect=0.0.0.0:$APPSVC_TUNNEL_PORT src/main/main.js"
  }
}

But I found that $APPSVC_TUNNEL_PORT did not have a value on the App Service machine. Do I need to enable some other setting to make sure this env var is populated correctly?

Or is there some better way entirely to get remote debugging working with Node and a custom file/script?

Any advice would be much appreciated!

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions