1
local dap = require('dap')
dap.adapters.firefox = {
  type = 'executable',
  command = 'node',
  args = { os.getenv('HOME') .. '/.local/share/nvim/mason/packages/firefox-debug-adapter/dist/adapter.bundle.js' },
}

dap.configurations.typescriptreact = {
  {
    name = 'Debug with Firefox',
    type = 'firefox',
    request = 'launch',
    reAttach = true,
    url = 'http://localhost:5173',
    webRoot = '${workspaceFolder}',
    firefoxExecutable = '/opt/firefox/firefox'
  }
}

Title explains the question. I have installed firefox-debug-adapter using Mason interface. Then I put the configuration above in the lunarvim config file. I run the vite dev server, set a breakpoint and click play in dap-ui to start debugging. Firefox-dev opens up a window and the app loads but The error message Neovim gives me is

Debug adapter didn't respond. Either the adapter is slow (then wait and ignore this) or there is a problem with your adapter or `firefox` configuration. Check the log
s for errors (:help dap.set_log_level)
Press ENTER or type command to continue // I press enter.

Error on launch: connect ECONNREFUSED ::1:6000
Press ENTER or type command to continue // press enter again

output of ":help dap.set_log_level"

Error detected while processing FileType Autocommands for "*":
Error executing lua callback: /usr/share/nvim/runtime/lua/vim/treesitter/query.lua:219: query: invalid node type at position 14 for language help
stack traceback:
        [C]: in function '_ts_parse_query'
        /usr/share/nvim/runtime/lua/vim/treesitter/query.lua:219: in function 'get_query'
        /usr/share/nvim/runtime/lua/vim/treesitter/languagetree.lua:52: in function 'new'
        /usr/share/nvim/runtime/lua/vim/treesitter.lua:45: in function '_create_parser'
        /usr/share/nvim/runtime/lua/vim/treesitter.lua:96: in function 'get_parser'
        .../start/nvim-treesitter/lua/nvim-treesitter/highlight.lua:34: in function 'start'
        .../start/nvim-treesitter/lua/nvim-treesitter/highlight.lua:42: in function 'attach'
        ...er/start/nvim-treesitter/lua/nvim-treesitter/configs.lua:505: in function 'attach_module'
        ...er/start/nvim-treesitter/lua/nvim-treesitter/configs.lua:528: in function 'reattach_module'
        ...er/start/nvim-treesitter/lua/nvim-treesitter/configs.lua:131: in function <...er/start/nvim-treesitter/lua/nvim-treesitter/configs.lua:130>

I have checked the path of firefox-debug-adapter if it was wrong. No problem there.

linusw
  • 1,140
  • 3
  • 9

0 Answers0