Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Next.js and React

The React Components and Profiler tabs do not show in Chrome DevTools

ErrorThe Components and Profiler tabs are missing from Chrome DevTools

Short answer

The React Developer Tools extension adds the Components and Profiler tabs only when React on the page can talk to it. They stay hidden when the page is not a React app, when it is opened from a file:// address without file access, when the extension's service worker is inactive, or when React runs inside an iframe. Check the global hook first, then fix the matching cause.

  • Applies to Chrome 102 or newer, React Developer Tools extension, React 19
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Open the DevTools console on the page and print the hook that the extension installs. If it prints undefined, the extension is not running on this page, so go to the file URL, service worker and iframe causes. If it prints an object, the extension is running, so look at the first cause.

    window.__REACT_DEVTOOLS_GLOBAL_HOOK__
  2. 2Match what you see, then jump to its fix

    1. 1The hook exists in the console, but no React tabs appearThe page does not run React, or React cannot reach the devtools hookFix
    2. 2The address bar starts with file:///The page is opened from a file:// addressFix
    3. 3service worker (inactive) next to the extension on the Chrome extensions pageThe extension's service worker is inactiveFix
    4. 4The page you open is a shell, and the React app is embedded in a frame inside itThe app runs inside an iframe, an extension or another unusual hostFix

What does the error look like?

  • The Components and Profiler tabs are missing from Chrome DevTools
  • service worker (inactive)

Cause 1 of 4

The page does not run React, or React cannot reach the devtools hook

1Check

The extension documentation says the tab does not appear if the site does not use React, or if React cannot communicate with the devtools. A static page, a docs site or the wrong port will all look like that. Confirm that the app you are looking at really depends on React.

npm ls react react-dom

2Fix

Open the address of the app that actually renders React, not a static page beside it. If React runs in a frame or another unusual host, use the standalone version from the last cause.

npm run dev

3Verify

Reload the page, close DevTools and open it again. The Components and Profiler tabs should be listed.

window.__REACT_DEVTOOLS_GLOBAL_HOOK__

Confirmed by github.com

Did this fix it?

Cause 2 of 4

The page is opened from a file:// address

1Check

The extension's README says that a page opened from a local file:// address needs the Allow access to file URLs setting turned on for the extension.

window.location.protocol

2Fix

Turn on Allow access to file URLs for the extension on the Chrome extensions settings page. The simpler way is to serve the folder over HTTP with a local server such as serve.

npx serve .

3Verify

Open the page through the http://localhost address that the server prints and reload.

window.location.protocol

Confirmed by github.com

Did this fix it?

Cause 3 of 4

The extension's service worker is inactive

1Check

Open the extensions page and look at the React Developer Tools card. An inactive worker means the extension is not talking to the page.

window.__REACT_DEVTOOLS_GLOBAL_HOOK__

2Fix

Disable the extension and enable it again. Then close DevTools, reload the page and open DevTools again.

# chrome://extensions: toggle off, toggle on; reload the page; reopen DevTools

3Verify

The card no longer says inactive, and the tabs appear after the reload.

window.__REACT_DEVTOOLS_GLOBAL_HOOK__

Confirmed by github.com

Did this fix it?

Cause 4 of 4

The app runs inside an iframe, an extension or another unusual host

1Check

The project's own guidance points to the standalone version for an app inside an iframe, a Chrome extension, React Native or another unusual environment.

npm ls -g react-devtools

2Fix

Install the standalone package, start it, and add its script as the first script in head while you debug. Remove that line before production.

npm install -g react-devtools
react-devtools

<!-- first script in <head>, development only -->
<script src="http://localhost:8097"></script>

3Verify

Reload the page. The standalone window should list the component tree.

window.__REACT_DEVTOOLS_GLOBAL_HOOK__

Confirmed by react.dev

Did this fix it?

How do I stop it coming back?

  • Serve local pages over http://localhost during development instead of opening files directly.
  • When the tabs vanish, check chrome://extensions for an inactive worker before you start debugging your own code.
  • Keep the standalone react-devtools installed for the one project that renders React inside a frame.
  • Remove the standalone script tag from the head before you ship.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.