vscode: Cannot find pwa-node on select enviroment

  • VSCode Version: 1.49.0
  • OS Version: Windows10 2004

image

NLWuCchY0e

resolveDebugConfiguration(_: WorkspaceFolder, config: DebugConfiguration): ProviderResult < DebugConfiguration > {
  // if launch.json is missing or empty
  if (!config.type && !config.request && !config.name) {
    const editor = window.activeTextEditor;
    const langid = editor?.document.languageId;
    if (editor && (
        langid === 'typescript' ||
        langid === 'javascript' ||
        langid === 'typescriptreact' ||
        langid === 'javascriptreact'
      )) {
      config.type = 'pwa-node';
      config.name = 'Launch';
      config.request = 'launch';
      config.program = '${file}';
      config.runtimeExecutable = 'deno';
      config.runtimeArgs = [
        "run",
        "--inspect-brk",
        "-A"
      ];
      config.attachSimplePort = 9229
    }
  }

  if (!config.program) {
    return window.showInformationMessage("Cannot find a program to debug").then(_ => {
      return undefined; // abort launch
    });
  }

  return config;
}

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 23 (10 by maintainers)

Most upvoted comments

@weinand I don’t think this is me – it looks like they’re building a Deno debugger, from resolveDebugConfiguration they return a pwa-node type config but VS Code alerts that that doesn’t exist. However they’re able to debug with pwa-node inside a launch config.