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

Unable to Launch Chrome Dev from JS Debug Console #1489

Closed
craigjperry2 opened this issue Dec 18, 2022 · 5 comments · Fixed by #1496
Closed

Unable to Launch Chrome Dev from JS Debug Console #1489

craigjperry2 opened this issue Dec 18, 2022 · 5 comments · Fixed by #1496
Assignees
Labels
author-verification-requested Issues potentially verifiable by issue author bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Milestone

Comments

@craigjperry2
Copy link

Describe the bug
Unable to launch a Chrome debugger by ctrl+clicking on an emitted URL from vite running in a JS debug console in vscode 1.74.1 running on MacOS Ventura 13.1 - i get the error:

Unable to launch browser: "Unable to find an installation of the browser on your system. Try installing it, or providing an absolute path to the browser in the "runtimeExecutable" in your launch.json."

The browser is visible in launch services:

/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -dump | grep "Google Chrome Dev"
...
path:                       /Applications/Google Chrome Dev.app (0x59b0)
...
executable:                 Contents/MacOS/Google Chrome Dev
...

To Reproduce
Steps to reproduce the behavior:

  1. With a js/ts project open in VSCode, launch a "JavaScript Debug Terminal" from the ctrl+shift+p menu
  2. Launch the project from the console, e.g. in my case npm run dev
  3. Ctrl+click on the URL emitted for the dev server, e.g. in my case Local: http://127.0.0.1:5173/
  4. See error: Unable to launch browser: "Unable to find an installation of the browser on your system. Try installing it, or providing an absolute path to the browser in the "runtimeExecutable" in your launch.json."

launch.json contains:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "chrome",
            "request": "launch",
            "name": "Launch Chrome against localhost",
            "webRoot": "${workspaceFolder}",
            "runtimeExecutable": "dev"
        }
    ]
}

Log File

with trace set to true, ctrl+clicking on the link emitted by npm run dev does not cause a new trace log to be generated.

Clicking the launch button in the debug view does cause a log to be created and successfully opens a blank chrome dev instance but obviously this does not open to the url emitted in the JS console

VS Code Version: 1.74.1 (arm64 build on MacOs 13.1)

Additional context

I did see that in https://github.com/microsoft/vscode-js-debug-browsers/blob/main/src/darwinChrome.ts#L39 it's not looking for Dev or Beta in the same way that Edge dev and beta are searched for https://github.com/microsoft/vscode-js-debug-browsers/blob/main/src/darwinEdge.ts#L39 - but i haven't attempted to verify further.

@craigjperry2 craigjperry2 added the bug Issue identified by VS Code Team member as probable bug label Dec 18, 2022
connor4312 added a commit to microsoft/vscode-js-debug-browsers that referenced this issue Dec 27, 2022
For microsoft/vscode-js-debug#1489

Also, cache lsregister lookup since it's slow and we do it twice.
@connor4312 connor4312 added this to the January 2023 milestone Dec 28, 2022
@connor4312
Copy link
Member

connor4312 commented Dec 28, 2022

This'll be fixed in the next nightly build (~7 hrs) please let me know if it works for you! https://github.com/microsoft/vscode-js-debug#nightly-extension


If not, verification steps:

  1. Be on macOS
  2. Have only Chrome dev or beta installed
  3. Don't have Edge set as your system default browser
  4. Create JavaScript Debug Terminal, and type https://code.visualstudio.com on the prompt
  5. Cmd+click on the link and verify it's launched correctly. (will take a few moments since it requires a launchservices lookup)

@connor4312 connor4312 added the author-verification-requested Issues potentially verifiable by issue author label Dec 28, 2022
@craigjperry2
Copy link
Author

Hey @connor4312 many thanks for that & happy new year to you! I'm testing with nightly v2022.12.1417 - which i think contains your change - the timestamp is around 7 hours after your comment - but i don't know how to verify for sure.

In any case it's not worked unfortunately. I'm not really sure why because your change looked good to me.

Verification steps performed:

  1. On ventura 13.1
  2. Only chrome dev installed (also confirmed lsregister -dump sees chrome dev and only chrome dev)
  3. Edge not installed
  4. Created js debug terminal, entered url as suggested, cmd+click = error:

Unable to launch browser: "Unable to find an installation of the browser on your system. Try installing it, or providing an absolute path to the browser in the "runtimeExecutable" in your launch.json."

NB: this was done in a fresh vs code instance (double checked vscode-js-debug disabled and vscode-js-debug-nightly enabled), not with a project workspace open so there is no launch.json interfering here.

@connor4312
Copy link
Member

It looks like there might be something wrong with our extension publishing or the marketplace; the version number is just the date. Will let you know when it's resolved...

@connor4312
Copy link
Member

The new nightly build is published now 🙂

@craigjperry2
Copy link
Author

Confirmed fixed on nightly v2023.1.317

Many thanks @connor4312 !

@connor4312 connor4312 added the verified Verification succeeded label Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author-verification-requested Issues potentially verifiable by issue author bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants