emacs-lsp / dap-mode

Emacs :heart: Debug Adapter Protocol
https://emacs-lsp.github.io/dap-mode
GNU General Public License v3.0
1.29k stars 180 forks source link

dap-firefox, dap-firefox-setup, extension/module is extracted but no script file #547

Open Inc0n opened 2 years ago

Inc0n commented 2 years ago

The error log is as follow, in *Firefox::Run stderr*

node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module '/Users/xception/.emacs.d/var/dap/extensions/vscode/firefox-devtools.vscode-firefox-debug/extension/out/firefoxDebugAdapter.js'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v17.0.1

Process Firefox::Run stderr finished

emacs version: 28 dap-mode version: 20211117.1555

ghost commented 2 years ago

I am experiencing almost the same issue with dap-node:

internal/modules/cjs/loader.js:905
  throw err;
  ^

Error: Cannot find module '/home/x/.local/share/emacs/dap/extensions/vscode/ms-vscode.node-debug2/extension/out/src/nodeDebug.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Process Node::Run stderr finished
rafiks commented 2 years ago

similar issue here. not sure if its an issue within emacs or if the file changed. I am going to try and see if I can manually download.

Contacting host: marketplace.visualstudio.com:443 Wrote /var/folders/r3/bxfgg2yn7_90v1vkj_y4_3740000gn/T/exttxsW6F.zip [/var/folders/r3/bxfgg2yn7_90v1vkj_y4_3740000gn/T/exttxsW6F.zip] End-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes one disk of a multi-part archive. In the latter case the central directory and zipfile comment will be found on the last disk(s) of this archive. unzip: cannot find zipfile directory in one of /var/folders/r3/bxfgg2yn7_90v1vkj_y4_3740000gn/T/exttxsW6F.zip or /var/folders/r3/bxfgg2yn7_90v1vkj_y4_3740000gn/T/exttxsW6F.zip.zip, and cannot find /var/folders/r3/bxfgg2yn7_90v1vkj_y4_3740000gn/T/exttxsW6F.zip.ZIP, period. dap-node: Downloading done!

rafiks commented 2 years ago

I was able to manually download and unpack on the folder. Still testing it out. On initial try, Node-debug and firefox did not launch. Chrome launch but it doesn't look like its configured properly.

mplanchard commented 2 years ago

I also ran into this for dap-gdb-lldb, for rust debugging. I was able to manually download the extension from https://marketplace.visualstudio.com/items?itemName=webfreak.debug and unpack it into the dap-gdb-lldb-path and get things working

yyoncho commented 2 years ago

The solution for now is to copy the extension here and download it from the repo: https://github.com/emacs-lsp/lsp-server-binaries/

dylanjw commented 1 year ago

@yyoncho Can you add more description to your proposed solution? Im not understanding.

woochica commented 1 year ago

Has anyone managed to get this solved?

I downloaded the latest version of the extension (firefox-devtools.vscode-firefox-debug-2.9.8.vsix). I extracted the file and it gives me this:

❯ tar xvf firefox-devtools.vscode-firefox-debug-2.9.8.vsix
x extension.vsixmanifest
x [Content_Types].xml
x extension/.mocharc.json
x extension/CHANGELOG.md
x extension/dist/adapter.bundle.js
x extension/dist/adapter.bundle.js.LICENSE.txt
x extension/dist/extension.bundle.js
x extension/dist/launcher.bundle.js
x extension/dist/mappings.wasm
x extension/dist/terminator/main.js
x extension/dist/terminator/manifest.json
x extension/icon.png
x extension/LICENSE.txt
x extension/package.json
x extension/README.md

There's nowhere firefoxDebugAdapter.js to be found.

I guess it's because github.com/firefoxide/vscode-firefox doesn't exist any more which is referenced in dap-firefox.el.

misieck commented 1 year ago

+1 on Originally posted by @woochica in https://github.com/emacs-lsp/dap-mode/issues/547#issuecomment-1419076149 I may add, the same extension does work in vscode. Did the extension api change?

cpol0 commented 1 year ago

Same problem here. I've rebuild the firefox extension https://github.com/firefox-devtools/vscode-firefox-debug 2.9.7 version and rollback until 2.9.4 (2 years ago) with the package command, there is absolutely no https://github.com/firefox-devtools/vscode-firefox-debug.js file. So it seem's to be broken since a very long time, did anyone try this extension successfuly recently?

Unfortunately, the alternative with dap-chrome (deprecated) seems not working too https://github.com/emacs-lsp/dap-mode/issues/369

nailuoGG commented 1 year ago

I'm encountering the same issue.

After analysis, we found that the plugin is downloaded from the following URL when calling the dap-xxx-setup:

Root Cause

The reason for this could be that no plugin version is passed in any dap-xxx-setup, and the api no longer supports downloading extension files using the latest version.

https://github.com/emacs-lsp/dap-mode/blob/374fd0511ef5349f7621c15f5ce2e22f307f6e68/dap-firefox.el#L46-L47

execution process

https://marketplace.visualstudio.com/_apis/public/gallery/publishers/%s/vsextensions/%s/%s/vspackage

The code for this can be found here:

https://github.com/emacs-lsp/dap-mode/blob/374fd0511ef5349f7621c15f5ce2e22f307f6e68/dap-utils.el#L57-L61

For instance, when running the command dap-firefox-setup, the download URL is as follows:

curl https://marketplace.visualstudio.com/_apis/public/gallery/publishers/firefox-devtools/vsextensions/vscode-firefox-debug/latest/vspackage

However, downloading from the above URL results in an error, and we must explicitly specify a version and cannot use 'latest', as shown below:

https://marketplace.visualstudio.com/_apis/public/gallery/publishers/firefox-devtools/vsextensions/vscode-firefox-debug/2.9.8/vspackage

Solution:

When there is no version passed, dap-utils-get-vscode-extension should query the latest version from the marketplace:

https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery
woochica commented 10 months ago

@nailuoGG for me pulling the latest version works well:

curl https://marketplace.visualstudio.com/_apis/public/gallery/publishers/firefox-devtools/vsextensions/vscode-firefox-debug/latest/vspackage --output

but the problem is that, regardless which version you fetch, none of them contain the firefoxDebugAdapter.js.

lrdass commented 5 months ago

Has anyone found the solution? none of the .vsix packages has the expected firefoxDebugAdapter.js in it