Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dap-debug: Error processing "launch": Error: Can't find Chrome - install it or set the "runtimeExecutable" field in the launch config #13614

Closed
stradicat opened this issue May 23, 2020 · 8 comments

Comments

@stradicat
Copy link
Contributor

Description :octocat:

dap-debug does not work when trying to debug Node.js applications:
Message: Error processing "launch": Error: Can't find Chrome - install it or set the "runtimeExecutable" field in the launch config

Reproduction guide 🪲

  • Start Emacs
  • Open or create a node app
  • Invoke dap-debug with M-m d d d, choose Chrome browse URL, then Browse url: http://localhost:4200
  • Press Return

Observed behaviour: 👀 💔
dap-debug fails, showing the following error message:

Error processing "launch": Error: Can't find Chrome - install it or set the "runtimeExecutable" field in the launch config.
  at Object.errP (/home/dmayr/.emacs.d/.extension/vscode/msjsdiag.debugger-for-chrome/extension/node_modules/vscode-chrome-debug-core/out/src/utils.js:262:13)
  at ChromeDebugAdapter.<anonymous> (/home/dmayr/.emacs.d/.extension/vscode/msjsdiag.debugger-for-chrome/extension/out/src/chromeDebugAdapter.js:71:57)
  at Generator.next (<anonymous>)
  at /home/dmayr/.emacs.d/.extension/vscode/msjsdiag.debugger-for-chrome/extension/out/src/chromeDebugAdapter.js:11:71
  at new Promise (<anonymous>)
  at __awaiter (/home/dmayr/.emacs.d/.extension/vscode/msjsdiag.debugger-for-chrome/extension/out/src/chromeDebugAdapter.js:7:12)
  at /home/dmayr/.emacs.d/.extension/vscode/msjsdiag.debugger-for-chrome/extension/out/src/chromeDebugAdapter.js:54:74
  at processTicksAndRejections (internal/process/task_queues.js:97:5)

Expected behaviour: ❤️ 😄
dap-debug showing me options to debug a javascript / Node.js application

System Info 💻

  • OS: gnu/linux
  • Emacs: 26.3
  • Spacemacs: 0.300.0
  • Spacemacs branch: develop (rev. c6f47bd)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: emacs
  • Completion: helm
  • Layers:
((c-c++ :variables c-c++-backend 'lsp-ccls)
 csv
 (dart :variables dart-sdk-path "~/flutter/bin/cache/dart-sdk/")
 (go :variables go-backend 'lsp go-tab-width 2)
 (html :variables web-fmt-tool 'prettier)
 java
 (javascript :variables javascript-backend 'lsp javascript-repl 'nodejs javascript-import-tool 'import-js javascript-fmt-tool 'prettier)
 (json :variables json-fmt-tool 'prettier)
 kotlin
 (markdown :variables markdown-mmm-auto-modes
           '("c" "c++" "dart"
             ("elisp" "emacs-lisp")
             "go" "html" "java" "javascript" "kotlin" "python" "rust" "sql" "typescript"))
 nginx
 (php :variables php-backend 'lsp)
 (python :variables python-backend 'lsp python-lsp-server 'pyls)
 react
 (rust :variables rust-backend 'lsp)
 shell-scripts sql
 (typescript :variables typescript-backend 'lsp)
 (vue :variables vue-backend 'lsp vue-fmt-tool 'prettier)
 windows-scripts yaml
 (helm :variables history-delete-duplicates t)
 auto-completion better-defaults cmake dap debug docker emacs-lisp emoji
 (geolocation :variables geolocation-enable-automatic-theme-changer t)
 git github gtags import-js lsp multiple-cursors
 (treemacs :variables treemacs-use-filewatch-mode t treemacs-use-collapsed-directories 3)
 (org :variables org-enable-github-support t org-enable-bootstrap-support t org-enable-trello-support t)
 pandoc prettier
 (shell :variables shell-default-height 32 shell-default-position 'bottom)
 spell-checking syntax-checking unicode-fonts version-control)
  • System configuration features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS GLIB NOTIFY LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS LIBSYSTEMD LCMS2

Additional information

The Chrome executable was chromium, I changed it to chromium-browser ( '(browse-url-chrome-program "chromium-browser")). It did not help.

@stradicat
Copy link
Contributor Author

Apparently, it's related to this issue:
emacs-lsp/dap-mode#244

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

@github-actions github-actions bot added the stale marked as a stale issue/pr (usually by a bot) label May 25, 2021
@lebensterben lebensterben added Reported upstream Dap JavaScript and removed stale marked as a stale issue/pr (usually by a bot) labels Aug 23, 2021
@lebensterben lebensterben reopened this Aug 23, 2021
@lebensterben
Copy link
Contributor

@DennisMayr
Have you followed the steps in https://emacs-lsp.github.io/dap-mode/page/configuration/#javascript

@stradicat
Copy link
Contributor Author

I had done so, but the problem arose when attempting to use Chromium instead of Chrome.

Since I've switched to Chrome and Firefox for these purposes, and the feature works with these browsers, this issue can be closed.

@allentiak
Copy link
Contributor

I've found a fix for using Chromium instead of Chrome.
Just manually specify the path to the Chromium executable via the runtimeExecutable key.

In my case, in a Debian system, it is in /usr/bin/chromium.

Taking the launch.json from https://emacs-lsp.github.io/lsp-mode/tutorials/debugging-clojure-script/#debugging, this would be (*):

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "chrome",
            "request": "launch",
            "name": "DAP clojurescript",
+            "runtimeExecutable": "/usr/bin/chromium",
            "url": "http://localhost:8080",
            "sourceMaps": true,
            "webRoot": "${workspaceFolder}",
            "sourceMapPathOverrides": {
                "*": "${workspaceFolder}/src/main/*"
            }
        }
    ]
}

(*): You have to delete the + sign from the snippet in order for it to work.

@allentiak
Copy link
Contributor

Mini-HOWTO: Spacemacs DAP Debugging for ClojureScript: #15546 (comment)

@lebensterben
Copy link
Contributor

See #13614 (comment) for a workaround.

@stradicat
Copy link
Contributor Author

Thanks for the tip, @allentiak, and @lebensterben for the heads-up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants