[描述]
我正在构建一个 IDE,通过使用 Visual Studio Code + chrome 扩展调试器来开发 chrome 扩展。经过一番尝试和错误后,我通过使用 使用源映射附加到 chrome Debug模式成功运行了源 java 脚本。但是当我使用调试控制台时,chrome总是立即崩溃...... 我该如何解决这个问题?
[症状]
调试器在断点处暂停,但当我使用调试控制台时,chrome 总是立即崩溃。
[环境]
- 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" } ] }
最佳答案
[根本原因]
[解决方案]
- 卸载 Chrome(稳定 channel )
- 安装Chrome (dev channel)
从控制台启动 Chrome
google-chrome --remote-debugging-port=9222 --enable-nacl
- 通过 使用源映射附加到 chrome 运行 VSCode 调试
- 享受吧!
[引用]
关于javascript - 使用 Visual Studio 代码调试控制台时 Chrome 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47747884/