React: Bug: DevTools tabs don't show up sometimes in latest release

Created on 26 May 2020  ·  45Comments  ·  Source: facebook/react

Note this issue is due to CR bug 1085215

It is impacting several other popular extensions as well- including React, Redux, Relay, and Vue devtools.


React version: 16.13.1
DevTools version: 4.7.0 (5/18/2020)
macOS version: 10.15.4 (19E287)

Steps To Reproduce

  1. Create a new profile in Google Chrome
  2. Install the React Developer Tools
  3. Go to https://reactjs.org
  4. Open the browser Dev Tools

Screenshots

Not sure this helps, but this is basically what I get after following the aforementioned steps:
image

When using Opera the tabs do show up:
image

The current behavior

Sometimes the Components and Profiler (i.e. React devtools tabs) don't show up.

The expected behavior

These tabs should show for any site using React.

More details

I've tried a few browsers, including:

  1. Google Chrome (83.0.4103.61)
  2. Microsoft Edge (83.0.478.37)
  3. Opera (68.0.3618.125)

All of them should be working, since they're all Chromium based.

The most reliable was Opera, which always shows the dev tools tabs. Chrome and Edge behaved the same way, sometimes showing them and other times not.

I've also taken a look at the background pages of the React Dev Tools extension and they don't show any errors, only these performance metrics in the devtools_app.html page:
image

The main background page shows nothing in the console at all times.

Developer Tools Bug Needs Investigation

Most helpful comment

We are also facing same issue for ChroPath
I didn't get permanent solution yet but here is the work around-

  1. Change the chrome DevTools theme, only once it is required.
  2. Now open devtools, you find the extension tab in DevTools.
  3. You can again change the theme whatever you want to keep and this will fix your problem.

All 45 comments

Hi there. I have the same problem. Maybe this info will be useful:
1) When I open some of "pages" (let it be P1) of my SPA, then open DevTools I can't see "Components" and "Profiler" tabs.
2) I close DevTools
3) Then I switch to the other "page" of SPA (let it be P2)
4) Open DevTools while I'm on P2
5) Now I see "Components" and "Profiler" tabs
6) Without closing DevTools I switch back to P1, the two tabs of RDT-extension still here, profit :)

@Roman-Popov Can you reliably reproduce this? Does it matter what p1 and p2 are? (If something about the apps seem significant, can you share them with me somehow so I can repro?)

Also which browser+OS

@Roman-Popov @bengry (or anyone else who sees this and can repro) If you can repro, would you be willing to try a new build of DevTools (that I could share here) to see if the problem still happens?

I could try making a build with #18860 backed out. (That's the only commit in the 4.6->4.7 change set that looks even remotely suspicious.)

@bvaughn About p1 and p2. Yep, looks like there is difference between them. P2, where RDT is not shown by default, contains much more dom-elements. And here is one more detail - Redux-devtools tab behaves exactly as RDT tabs.

What about https://reactjs.org/ page (problem mentioned by @bengry) - I saw that too. But checked it again now and don't see problems. Tabs are shown, everything is fine.

Probably in my case there is some memory issue in my project or something like this. Because If I remove long lists from P2, devtools tabs shows up.

Chrome v83.0.4103.61
Chrome Canary v85.0.4157.0
Win 10 Pro 1903

@Roman-Popov Thanks for the added information!

Any chance you can share the repro (or access to it) with me so I can see what's going on?

Alternately, would you be willing to install a one-off devtools build if I attach one here? (Just to see if you can still repro with it)

I have encountered the same issue in our SPA. I was able to get the Components and Profiler tabs to appear in Chrome Dev Tools when I inspected our app in mobile "view" (which changes the initial components rendering). I refreshed and changed back to desktop/responsive "view" (dev tools open the whole time) the tabs remained visible.

For our SPA, the biggest difference between mobile and desktop landing page is that on desktop we render a drawer open with a react-virtualized list. This drawer is not open or rendered immediately on mobile. I'm not sure if this info helps, I know it's just a breadcrumb. I will update if I find anything else.

Would be happy to try a custom build to see if it resolves the issue.

Because If I remove long lists from P2, devtools tabs shows up.

Yep! React-virtualized. I use that too for long lists I mentioned in my previous message.
overscanRowCount={600} is set for wrapped list. It's big enough, but there are only very lightweight placeholders with couple dom-elements (for keep browser search trough the list by pressing ctrl+f). If I downgrade overscanRowCount to +-50, then the problem with missing tabs is gone.

Interesting. So it sounds like the problem has something to do with the size of the tree, or maybe the number of children in a single parent... @Roman-Popov could you by chance repro this in a Code Sandbox or something? (Since I can't look at P2 directly I assume?)

In other news though- overscanRowCount={600} seems...very unexpectedly high. I would not have advised that value being over a single digit number. RV and RW exist to avoid generating and working on long lists. 600 means it's rendering the viewport rows, plus as many as 1,200 extra ones.

Does reactjs.org use react-virtualized as well? Because the issue reproduced for me there too (in fact, this issue was opened with that as the example). We do use it in our app, but with a smaller overscan count, and it still happened there.

Does reactjs.org use react-virtualized as well? Because the issue reproduced for me there too

Working fine for me in reactjs.org.

In our own app we don't use react-virtualized, yet we can reproduce the issue.

edit: I'm having the same issue on a new react app created by create-react-app.

I think this might be related with Chrome 83, I started having this problem after upgrading to 83 and I can reproduce it on Chrome Canary 85.

A colleague using Chromium 81 doesn't have the problem using the same app.

@bvaughn

overscanRowCount={600} seems...very unexpectedly high.
....
RV and RW exist to avoid generating and working on long lists

True :D I know about performance. That was not good, but fast solution. Later I do some kind of custom search of course :)
About source code to show my app and try to reproduce - sorry, I think I can't do that, NDA and so on, you know. But I can try to make some small CRA-project with react-virtualized lists, heavy pages etc. And share that repo if I catch this bug again. I'll tryto find some time to this investigation)

I think this might be related with Chrome 83, I started having this problem after upgrading to 83 and I can reproduce it on Chrome Canary 85.

A colleague using Chromium 81 doesn't have the problem using the same app.

This would be really useful info to get confirmed. @ianvieira how reliably can you reproduce this problem? If very reliably, could you try an older Chromium version and see if it no longer reproduces?

If so, let me know and I'll reach out to the Chrome team.

Just to try one extra thing, if anyone else can repro this issue pretty reliably, would you try this extension build and let me know if it helps?

ReactDevTools.zip

I don't really expect it to, but I'd like to rule out recent WebPack changes.

To instal the extension above:

  1. Download it and unzip it somewhere
  2. Open chrome://extensions/ in your browser
  3. Click the little toggle to disable the React DevTools extension
  4. Click the "Load Unpacked" button
  5. Select the unzipped extension folder from step 1

installKapture 2020-05-28 at 10 49 16

@bvaughn I thought I could consistently reproduce it but after going to https://reactjs.org (which displayed the tabs correctly) and going back to my application with the console opened, now it's working consistently.

On Chrome Canary I still can reproduce it consistently on my app with several nodes. I'll try the version you sent.

I noticed this seems to kill all my other extension-added console tabs as well. Redux, etc.

I noticed this seems to kill all my other extension-added console tabs as well. Redux, etc.

I'm starting to suspect this has something to do with Chrome.

I've heard reports from others saying that Relay DevTools is crashing, which causes React DevTools to break. Now I'm seeing you say that this affects Redux DevTools as well.

There's nothing React (or Relay) should be doing that should affect each other, or Redux extension.

I noticed this seems to kill all my other extension-added console tabs as well. Redux, etc.

I noticed the same. I just tried in Chrome Canary, I had the same behavior, after going to https://reactjs.org the React tabs appears, together with others:

image

I tried before with https://localhost:3000 (with no success opening and closing Dev Tools) and with https://farfetch.com. The tabs just reappeared with https://reactjs.org and after closing the Dev Tools between Farfetch and React and refreshing the page.

Oh btw, I was using the version you sent @bvaughn.

For some reason, I can see the tabs only at https://reactjs.org on Canary. Localhost stills without it (not only the react ones but all of them). I suspect I have the tab on the stable because I opened localhost after React docs with the Dev tools opened.

I tried to do the same but I cannot have it on localhost consistently at Chrome Canary.

EDIT: After closing the browser tab I accessed React docs on stable, the tabs are missing again. It really seems to be a Chrome issue

This issue is not deterministic. Sometimes it works, sometimes it doesn't. I don't think we should read too much into a single success.

Chrome v83 happened to release one day after React DevTools v4.7.

Here is the previous version of React DevTools (4.6) if anyone would like to try it to see if anything changes:
ReactDevTools-4.6.zip

It's sounding more and more like a Chrome issue though from what I'm hearing.

Neither the experimental version nor 4.6 is working for me (only the workaround mentioned above). I also have the feeling that this is a Chrome issue, as the bug occurred after updating Canary some days ago and persists since that, but the extension works correctly in Stable.

Also may be worth noting that reactjs.org has always had occasional issues with the extension tab not showing up. I'm not sure why, but an occasional failure there isn't a new thing. What seems to be new is the frequency of this failure, and the fact that it's happening for other sites, and the fact that it seems to also be happening for other extensions. (This is why I think it's a Chrome/Chromium issue)

I have no idea how the extension works and I'm also not able to create a reduced test case. But maybe this helps you in any way:

On reactjs.org where the extension works, the window object has __REACT_DEVTOOLS_COMPONENT_FILTERS__, __REACT_DEVTOOLS_APPEND_COMPONENT_STACK__ and __REACT_DEVTOOLS_GLOBAL_HOOK__.

The latter looks like this:

works

On the app where the extension does not work, only __REACT_DEVTOOLS_GLOBAL_HOOK__ exists and looks like this:

fails

Is there a way to hook into the extension (main.js?), maybe even attach a debugger, to find a potential error? (I tried background.js but this does no seem to be the correct place to look at.)

@bvaughn i also think this may be a Chromium bug (note Chromium, and not Chrome, since I get the exact same buggy behavior in Edge). Opera works just fine for me with the most recent RDT though, so I guess they haven't updated to Chromium 83 yet (though I'm not near a computed to check right now).

I opened the bug here since it does seem to be relayed to the RDT (I also didn't know about others like Relay and Redux DT not working), so it might be with some integration between the two. Maybe an extension API that's causing the issue and changed In Chromium 83.

Did you contact the Chromium/Chrome team on this as you mentioned earlier?

Agreed at this point that it seems likely to be a Chromium bug (that rolled out with the recent Chrome 83 and Edge 83 updates).

I have pinged one of the dev rels on Twitter but I haven't yet heard back.

Is there a way to hook into the extension (main.js?), maybe even attach a debugger, to find a potential error? (I tried background.js but this does no seem to be the correct place to look at.)

@maxbeier There are a couple of ways to debug extensions. Some extensions inject code into the page you are viewing (as does React DevTools) in which case you can just debug it using the normal work flow.

You might also want to debug the extension UI itself, which you can do by detaching/undocking the DevTools panel, and popping out a second DevTools window to inspect the first, like so (I'm using ⌘ + J):
undockKapture 2020-05-28 at 14 39 53

You can also open the extension (chrome://extensions/?id=aogeonfmjfclepddhjhilmncnhooehhl) and choose "Details" and "Inspect views".

By the way, this appears to be a Chromium issue that is also impacting Vue and Redux DevTools.

If you have a CR bug account, consider starring this issue:
https://bugs.chromium.org/p/chromium/issues/detail?id=1085215

I'm not sure if this is the answer you're looking for but in Urql Devtools we've tried to move away from using chrome.devtools.inspectedWindow.eval in favor of handshaking because of unpredictability like this.

The problem with evaluating an inspected window is you can end up with race conditions or a dependency on polling as is in the case on react devtools.

const loadCheckInterval = setInterval(function() {
  createPanelIfReactLoaded();
}, 1000);

I haven't been able to reproduce the bug but I wouldn't be surprised if chrome is doing something funky with interval calls in extensions. It's not fun but handshaking might make things a little more straight forward, I know messaging is something that the chrome docs encourage over window evals for security reasons.

That's an interesting suggestion, @andyrichardson. Thank you!

We are also facing same issue for ChroPath
I didn't get permanent solution yet but here is the work around-

  1. Change the chrome DevTools theme, only once it is required.
  2. Now open devtools, you find the extension tab in DevTools.
  3. You can again change the theme whatever you want to keep and this will fix your problem.

Thanks, @sanjayautonomiq, this work for me

This has been happening for me for over a year in chrome. usually reloading the page the components and profiler tab reappear. just wanted to point out that its not just latest release, its been happening since v16 as long as i can remember

This has been happening for me for over a year in chrome. usually reloading the page the components and profiler tab reappear. just wanted to point out that its not just latest release, its been happening since v16 as long as i can remember

I think that may be something on your end then, as personally I haven't seen this in the last year AFAIR - and as mentioned, this does not happen in latest Opera at the time of writing this (Opera 68, Chromium 81), and for me refreshing the page doesn't help. The workaround suggested by @sanjayautonomiq does though.
Even if this bug has existed for at least a year, something in the recent couple of weeks has made it worse (new Chromium and/or new RDT versions) - as evident from all the reactions in this issue.

Even if this bug has existed for at least a year, something in the recent couple of weeks has made it worse (new Chromium and/or new RDT versions) - as evident from all the reactions in this issue.

Certainly true. I pinged the CR bug again. This regression is pretty disruptive.

FYI, I just flagged http://crbug.com/1085215 as a duplicate of http://crbug.com/1093731. A fix for the latter issue was submitted ~8 days ago. Please retest in Canary and, if the issue is not addressed, dedupe 1085215.

Does indeed look like the Canary fix resolves this issue (or at least makes it MUCH harder to repro). Going to leave this issue open until the fix has rolled to Chrome stable though, as we're getting a lot of duplicate reports of this already.

We are also facing same issue for ChroPath
I didn't get permanent solution yet but here is the work around-

  1. Change the chrome DevTools theme, only once it is required.
  2. Now open devtools, you find the extension tab in DevTools.
  3. You can again change the theme whatever you want to keep and this will fix your problem.

Worked like a charm for me, thanks! Was about to try banging my head against the wall.

This is so weird.

I have to change the devTools theme to fix this issue.

Thank you, @sanjayautonomiq

But this is a bug.

But this is a bug.

Yes.

Specifically, it's a Chrome bug (CR bug 1085215) as mentioned in the issue description :smile: Nothing we can do (here) to fix it.

This seems to be resolved now for me in Chrome stable so I'm going to close this issue.

This seems to be resolved now for me in Chrome stable so I'm going to close this issue.

Still reproduces for me on Chrome 83.0.4103.116.

I agree this has no fix on the RDT side, but might be worth keeping this issue open until this is fixed in Chrome.

Same issue here Version 83.0.4103.116 (Official Build) (64-bit)

I'll chime in and say it's also an issue for me (Version 83.0.4103.116).

Hey folks. It's probably not worth adding more "+1" comments here since this is a Chromium bug. There's nothing I can do about it on the extension side to make it work. The "+1" votes would be better spent on the Chromium bug itself :smile: so that Google knows it's impacting a lot of people.

That being said, the CR bug has been marked as fixed and scheduled for cherry picking into v84 of Chrome as per this comment so it should be resolved soon for everyone hopefully.

In the meanwhile I am going to lock this issue just to avoid notification-spamming everyone who has already commented above.

Was this page helpful?
0 / 5 - 0 ratings