daveleroy / SublimeDebugger

Graphical Debugger for Sublime Text for debuggers that support the debug adapter protocol
MIT License
369 stars 42 forks source link

Unable to launch or attach to firefox #185

Open eidellev opened 1 year ago

eidellev commented 1 year ago

Hi and thanks for this plugin. The last few releases were really 🔥 !

While the chrome adapter works without any issues I can't seem to get firefox to work in either launch or attach mode. I'm getting the following error in the Sublime console:

Debugger: Nothing to read from process, closing
Debugger: error: event ignored not implemented unknownSource

This is my config for launching firefox:

{
  "type": "firefox",
  "request": "launch",
  "reAttach": true,
  "name": "Launch firefox 🦊",
  "url": "http://localhost:3000/index.html",
  "webRoot": "${folder}",
  "port": 3000,
  "firefoxExecutable": "/Applications/Firefox Developer Edition.app/Contents/MacOS/firefox"
},
daveleroy commented 1 year ago

Its probably because its like 2 years old on openvsx https://open-vsx.org/extension/firefox-devtools/vscode-firefox-debug

eidellev commented 1 year ago

Well that's depressing.. any way to install it manually?

daveleroy commented 1 year ago

You could build it and replace what was placed in Packages/Debugger/data/adapters/firefox

eidellev commented 1 year ago

Thanks! I'll give it a shot

eidellev commented 1 year ago

The error I saw before is gone, but firefox is still not launching 🤔 This is what I'm seeing in the Debugger Protocol tab:

⟸ process/stopped :: 
⟸ process/starting :: ['/usr/local/bin/node', '/Users/lev/Library/Application Support/Sublime Text/Packages/Debugger/data/adapters/firefox/extension/dist/adapter.bundle.js']
⟸ process/started ::
⟸ request/initialize(1) :: {'clientID': 'sublime', 'clientName': 'Sublime Text', 'adapterID': 'firefox', 'pathFormat': 'path', 'linesStartAt1': True, 'columnsStartAt1': True, 'supportsVariableType': True, 'supportsVariablePaging': False, 'supportsRunInTerminalRequest': True, 'supportsMemoryReferences': True, 'locale': 'en-us'}
⟹ response/initialize(1) :: {'supportsConfigurationDoneRequest': False, 'supportsEvaluateForHovers': False, 'supportsFunctionBreakpoints': False, 'supportsConditionalBreakpoints': True, 'supportsSetVariable': True, 'supportsCompletionsRequest': True, 'supportsDelayedStackTraceLoading': True, 'supportsHitConditionalBreakpoints': True, 'supportsLogPoints': True, 'supportsDataBreakpoints': True, 'supportsBreakpointLocationsRequest': True, 'exceptionBreakpointFilters': [{'filter': 'all', 'label': 'All Exceptions', 'default': False}, {'filter': 'uncaught', 'label': 'Uncaught Exceptions', 'default': True}]}
⟸ request/launch(2) :: {'name': 'Launch firefox 🦊', 'port': 3000, 'reAttach': True, 'request': 'launch', 'type': 'firefox', 'url': 'http://localhost:3000/index.html', 'webRoot': '/Users/lev/Projects/zencity/community/client'}
⟹ event/initialized :: None
⟸ request/setExceptionBreakpoints(3) :: {'filters': ['uncaught'], 'filterOptions': [ExceptionFilterOptions(filterId='uncaught', condition=None)]}
⟸ request/setDataBreakpoints(4) :: {'breakpoints': []}
⟹ response/setExceptionBreakpoints(3) :: None
⟹ response/setDataBreakpoints(4) :: {'breakpoints': []}
daveleroy commented 1 year ago

I think you are asking firefox to use the same port for remote debugging that you are using for serving your content which is probably causing issues

eidellev commented 1 year ago

thanks! now firefox launches but the debugger fails to attach.

this my current config:

{
    "type": "firefox",
    "request": "launch",
    "reAttach": true,
    "name": "Launch firefox 🦊",
    "url": "http://localhost:3000/index.html",
    "webRoot": "${folder}",         
},

and this is the error i'm seeing in the debugger console:

connect ECONNREFUSED ::1:6000
Debugging ended

if i understood this correctly, port 6000 is supposed to be used in attach mode only. any idea what's going on?

daveleroy commented 1 year ago

As far as I can tell the launch request is just opening firefox and configuring it for remote debugging. Port 6000 is the default port they use.

You can look to see what port is being used by firefox with about:debugging

eidellev commented 1 year ago

Tried the port that's configured there (6080) but still getting the same error. btw, I tried the same config in VSCode and it works there so I'm kinda stuck.