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

Fix Razor browser discovery issues on Mac and Linux #6269

Merged

Conversation

allisonchou
Copy link
Contributor

@allisonchou allisonchou commented Sep 1, 2023

Fixes
https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1842267/ and
https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1865790/

Marked as dupes but they were actually two separate issues:

  • Mac: @vscode/js-debug-browsers, which we use to determine which browsers the user has installed, expected an execa object to be passed into one of their methods we were calling. However, they only expected this on Macs (which is probably why this wasn't caught sooner).
  • Linux: We needed to upgrade @vscode/js-debug-browsers to a newer version, since the old version contained buggy code that resulted in one of the filed bugs above.

Other notes:

  • I also tried exploring adding Firefox support, but unfortunately it appears VS Code only supports Edge/Chrome as built-in debug browsers.

showErrorMessage(vscode, vscode.l10n.t('Run and Debug: A valid browser is not installed'));
showErrorMessage(
vscode,
vscode.l10n.t('Run and Debug: A valid browser is not installed. Please install Edge or Chrome.')
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated error message to explicitly say which browsers we support.

const chromeBrowserFinder = new ChromeBrowserFinder(process.env, promises, null);
const chromeInstallations = await chromeBrowserFinder.findAll();
if (chromeInstallations.length > 0) {
// favoring Edge if multiple valid options are installed.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought we should re-order browser priority so that we favor Edge over Chrome (since we're Microsoft 😄). Let me know if anyone has other thoughts.

@allisonchou allisonchou changed the title [draft] validation Fix Razor browser discovery issues on Mac and Linux Sep 2, 2023
@allisonchou allisonchou marked this pull request as ready for review September 2, 2023 02:04
@allisonchou allisonchou requested review from a team as code owners September 2, 2023 02:04
@allisonchou allisonchou enabled auto-merge (squash) September 5, 2023 20:22
@allisonchou allisonchou merged commit 4ee2699 into dotnet:main Sep 5, 2023
5 of 7 checks passed
@allisonchou allisonchou deleted the dev/allichou/FixRazorBrowserDiscovery branch September 5, 2023 21:09
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

Successfully merging this pull request may close these issues.

2 participants