javascript - 使用 Visual Studio 代码调试控制台时 Chrome 崩溃

标签 javascript google-chrome visual-studio-code

[描述]

我正在构建一个 IDE,通过使用 Visual Studio Code + chrome 扩展调试器来开发 chrome 扩展。经过一番尝试和错误后,我通过使用 使用源映射附加到 chrome Debug模式成功运行了源 java 脚本。但是当我使用调试控制台时,chrome总是立即崩溃...... 我该如何解决这个问题?

[症状]

调试器在断点处暂停,但当我使用调试控制台时,chrome 总是立即崩溃。 chrome_crash

chrome 崩溃日志 enter image description here

[环境]

  • Ubuntu 17.10
  • Visual Studio 代码 1.18.1
  • Chrome 3.5.0 调试器
  • 谷歌浏览器 63.0.3239.84
  • launch.json

    {
        // Use IntelliSense to learn about possible Node.js debug attributes.
        // Hover to view descriptions of existing attributes.
        // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
        "version": "0.2.0",
        "configurations": [
            {
                "name": "Launch Chrome against localhost, with sourcemaps",
                "type": "chrome",
                "request": "launch",
                "url": "http://10.19.202.100:8080",
                "sourceMaps": true,
                "webRoot": "${workspaceRoot}"
            },
            {
                "name": "Attach to Chrome, with sourcemaps",
                "type": "chrome",
                "request": "attach",
                "port": 9222,
                "sourceMaps": true,
                "webRoot": "${workspaceRoot}/src"
            }
        ]
    }
    

最佳答案

[根本原因]

  • 异常(exception):本地人已禁用
  • Chrome 稳定版无法启用原生客户端 enter image description here

[解决方案]

  • 卸载 Chrome(稳定 channel )
  • 安装Chrome (dev channel)
  • 从控制台启动 Chrome

    google-chrome --remote-debugging-port=9222 --enable-nacl
    
  • 通过 使用源映射附加到 chrome 运行 VSCode 调试
  • 享受吧! enter image description here

[引用]

关于javascript - 使用 Visual Studio 代码调试控制台时 Chrome 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47747884/

相关文章:

javascript - 使用 google maps 模块依赖运行 Karma 测试

javascript - 在 Angular 中将 Promise 从一个服务调用传递到另一个服务调用

android - 深层链接在 Chrome 中不起作用

javascript - 代码在 Firefox 或 IE 中无法正常运行

visual-studio-code - vscode jshint 配置

javascript - typescript 代码中是否需要构造函数?

javascript - es6 map 的替代方案

javascript - Codewars Kata 的问题 - 增加数组的最大差异

javascript - 如何通过 javascript(chrome 扩展)将文本从一个选项卡复制并粘贴到另一个选项卡?

clojure - 在 VS CODE 中运行 (lein) REPL