angular - 未绑定(bind)断点 - VS Code | Chrome | Angular

标签 angular google-chrome visual-studio-code vscode-debugger angular10

我有一个 Angular 应用程序,我试图在 VS Code 中进行调试.
当我编译并运行应用程序( ng serve )时,断点被绑定(bind):
enter image description here
但是,当我指定不同的配置时,例如-c qa-c uat它们不受约束:
enter image description here

  • 为什么当我指定不同的断点时未绑定(bind)
    配置?
  • 如何绑定(bind)针对特定环境的调试 session 的断点?

  • 相关信息
    angular.json 示例环境配置:
    "uat": {
      "fileReplacements": [
        {
          "replace": "src/environments/environment.ts",
          "with": "src/environments/environment.uat.ts"
        }
      ],
      "optimization": true,
      "outputHashing": "all",
      "sourceMap": false,
      "extractCss": true,
      "namedChunks": false,
      "extractLicenses": false,
      "vendorChunk": false,
      "buildOptimizer": true,
      "budgets": [
        {
          "type": "initial",
          "maximumWarning": "2mb",
          "maximumError": "5mb"
        },
        {
          "type": "anyComponentStyle",
          "maximumWarning": "6kb",
          "maximumError": "10kb"
        }
      ]
    },
    
    软件版本控制:
  • Visual Studio Code 1.50.1
  • Chrome 83.0.4103.122
  • Debugger for Chrome 4.12.11
  • JavaScript Debugger (Nightly) 2020.10.2217
  • 最佳答案

    解决这个问题很简单,我没有设置 sourceMap属性(property)给 true在那个特定环境的 angular.json 中,我有 "sourceMap": false,https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/SourceMap了解更多信息。
    感谢康纳 - https://github.com/microsoft/vscode-js-debug/issues/872

    关于angular - 未绑定(bind)断点 - VS Code | Chrome | Angular ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64589447/

    相关文章:

    javascript - 如何将 jwt token 应用于生成的 Angular 2 JS 文件?

    css - Chrome 的站点可视化问题

    reactjs - 在 TypeScript 项目之间共享代码(使用 React)?

    javascript - 使用 keydown 处理程序控制焦点时,焦点轮廓在 Chrome 中不可见

    css - 计算出的 margin 与声明值有亚像素偏差

    macos - Visual Studio Code 1.32 - 它卡在智能感知上

    visual-studio-code - 有没有办法将 VSCODE 配置为与 CVS 一起使用?

    angular - Angular 2 RC4 中的表单

    javascript - 在调用函数之前设置类范围变量

    angular - Azure 静态 Web 应用 API 中的 TypeORM 迁移