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-firefox, dap-firefox-setup, extension/module is extracted but no script file #547

Open
Inc0n opened this issue Jan 5, 2022 · 12 comments

Comments

@Inc0n
Copy link

Inc0n commented Jan 5, 2022

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
Copy link

ghost commented Jan 13, 2022

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
Copy link

rafiks commented Jan 20, 2022

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
Copy link

rafiks commented Jan 20, 2022

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
Copy link

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
Copy link
Member

yyoncho commented Jan 26, 2022

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
Copy link

dylanjw commented Oct 3, 2022

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

@woochica
Copy link

woochica commented Feb 6, 2023

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
Copy link

misieck commented Feb 10, 2023

+1 on Originally posted by @woochica in #547 (comment)
I may add, the same extension does work in vscode. Did the extension api change?

@cpol0
Copy link

cpol0 commented Mar 7, 2023

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 #369

@nailuoGG
Copy link

nailuoGG commented Jun 2, 2023

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.

dap-mode/dap-firefox.el

Lines 46 to 47 in 374fd05

(dap-utils-vscode-setup-function "dap-firefox" "firefox-devtools" "vscode-firefox-debug"
dap-firefox-debug-path)

execution process

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

The code for this can be found here:

dap-mode/dap-utils.el

Lines 57 to 61 in 374fd05

(defcustom dap-utils-vscode-ext-url
"https://marketplace.visualstudio.com/_apis/public/gallery/publishers/%s/vsextensions/%s/%s/vspackage"
"Vscode extension template url."
:group 'dap-utils
:type 'string)

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
Copy link

@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
Copy link

lrdass commented Mar 1, 2024

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

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

No branches or pull requests

10 participants