Skip to content

Breaking changes to JavaScript Debug Configuration

Eric Jizba edited this page Feb 1, 2019 · 1 revision

The debug configuration for v2 of the Azure Functions runtime has changed and old configurations will likely fail with the error "Cannot connect to runtime process, timeout after 10000 ms". You will automatically be prompted to update your configuration when you open a project. However, you can manually update your project with one of the following options:

The first option is to add languageWorkers__node__arguments to your runFunctionsHost task in .vscode\tasks.json as seen below:

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "runFunctionsHost",
      "type": "shell",
      "command": "func host start",
      "options": {
        "env": {
          "languageWorkers__node__arguments": "--inspect=5858"
        }
      },
      "isBackground": true,
      "problemMatcher": "$func-watch"
    }
  ]
}

The second option requires two steps:

  1. Pass the --language-worker parameter to func host start in your runFunctionsHost task in .vscode\tasks.json as seen below:

    {
      "version": "2.0.0",
      "tasks": [
        {
          "label": "runFunctionsHost",
          "type": "shell",
          "command": "func host start --language-worker -- \"--inspect=5858\"",
          "isBackground": true,
          "problemMatcher": "$func-watch"
        }
      ]
    }
  2. Add the FUNCTIONS_WORKER_RUNTIME setting to your local.settings.json:

    {
      "IsEncrypted": false,
      "Values": {
          "AzureWebJobsStorage": "",
          "FUNCTIONS_WORKER_RUNTIME": "node"
      }
    }

The recommended debug configuration going forward has not been finalized. It will likely be similar to Option 2, but without a change to local.settings.json (since that file is not tracked by git). See here for more information.