How to add react dev tools to chrome when debugging in vscode
I was able to get the react-devtools tab with following steps.
- Install the react-devtools extension in the window opened by VScode (Again)
- Reopen devtools (CMD-ALT-i)
- Refresh the page.
I know there could be a better way. I think the chrome window opened by VScode must be protected from loading Extensions like in private mode. Answers welcome.
Try adding this line to your launch configuration, launch.json:
"runtimeArgs": ["--load-extension=${env:userprofile}/AppData/Local/Google/Chrome/User Data/Default/Extensions/fmkadmapgofadopljbjfkapdkoienihi/3.2.3_0"]
Some limitations
- Installation points to local folder based on ID of Chrome extension (enable developer mode to see it) - "fmkadmapgofadopljbjfkapdkoienihi"
- Path also points to a specific version (3.2.3_0), which may break on future releases of React dev tools
- Chrome gives a warning "Disable developer mode extensions" when an extension is loaded locally
Sources
- VS Code Variables
- Chrome command line switches