0

No matter what I do, I cannot get Rider to use Chrome for debugging. I've removed all other browsers listed and even set a "Custom path" to Chrome. I also have the required plugins installed and enabled; still, it starts up with:

Opening <URL> using the default OS app (=Edge)

It then starts logging errors like below:

  1. Debugger listening on ws://...
  2. Debugger attached.
  3. Waiting for the debugger to disconnect...
  4. About to exit with code: 0
    Process terminated before summary could be written, possible error in async code no continuing!
    Trying to exit with exit code 1
    Process finished with exit code 0

enter image description here

The app consists of multiple SharePoint Framework (SPFx) React projects wrapped in netstandard2.0 class library projects. Each has a gulp file and I've created corresponding run/debug configurations similar to the below sample:

enter image description here

What do I need to do to get Rider to use Chrome?

ChiefTwoPencils
  • 13,548
  • 8
  • 49
  • 75

1 Answers1

2

In Gulp run configuration, you can't specify a browser to be used for debugging, neither you can debug the front-end app that runs in browser using this configuration. I suppose, it's your Gulp task that opens your system default browser once your app is started - the IDE has no control over this.

Anyway, to attach the debugger to the application that runs in browser, you need using JavaScript Debug run configuration with your server URL. In this configuration, you need to specify a browser to be used (the IDE will use Chrome there by default)

Also, I'd suggest removing --inspect option from Node options: in Gulp run configuration - it makes no sense here unless you are going to debug your Gulp task itself.

lena
  • 90,154
  • 11
  • 145
  • 150
  • That worked, sort of. It does connect but: 1) it opens a new chrome browser with no profiles and I need the ability to move between 5 or so to exercise group permissions 2) it's not actually hitting any breakpoints set in Rider; it's attached and logging but not hitting breakpoints unless I set them in Chrome which seems to defeat the purpose. Even then, when it loads the remote copy, it's the webpack file so... These issues probably have more to do with how SPFx projects work. – ChiefTwoPencils Oct 26 '21 at 17:05
  • 2
    1. this is done to make sure that no instances that use the same user data are running, as a port for debugging can't be opened after browser is started. Note that you can modify Chrome settings in **Settings | Tools | Web Browsers** to launch Chrome with your own user data (settings, extensions, etc.) - see https://www.jetbrains.com/help/webstorm/configuring-javascript-debugger.html#ws_js_debug_default_chrome_user_data But, if you do this, always make sure that Chrome is not already running with your user data before starting a debugging session, it won't work otherwise. – lena Oct 27 '21 at 11:10
  • 2
    2. must be a problem with sourcemaps. In Chrome Dev Tools, Sources tab, can you see your original source files (and not the transpiled versions)? If yes, sourcemaps are likely fine, and you can let the IDE know how the file path on disk maps to the URL in browser by copying the file URL from dev tools (**Copy link address** in script right-click menu) and specify URL mappings for folders in JavaScript Debug run configuration – lena Oct 27 '21 at 11:14