[react-devtools-extensions] Bug: Uncaught TypeError: Cannot read property 'sub' of undefined when navigating to plain-text pages
See original GitHub issueReact Developer Tools: 4.4.0 f749045a5 (1/3/2020) from chrome webstore Chromium: 81.0.4024.0 snapshot Ubuntu: 18.04
Steps To Reproduce
- Open chrome with React Developer Tools installed
- Open developer console
- In console settings (cogwheel in console’s top right corner) check “Preserve log” checkbox (to make sure that the log is not overwritten on navigation)
- Navigate to a React-enabled website, e.g.
https://reactjs.org
- Navigate to a plain-text page, such as
https://reactjs.org/robots.txt
The current behavior
Error is printed in console:
backend.js:32 Uncaught TypeError: Cannot read property 'sub' of undefined
at g (backend.js:32)
at e (backend.js:8)
g @ backend.js:32
e @ backend.js:8
postMessage (async)
a @ contentScript.js:1
117 @ contentScript.js:1
n @ contentScript.js:1
(anonymous) @ contentScript.js:1
(anonymous) @ contentScript.js:1
where backend.js
is a link to chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/backend.js
fmkadmapgofadopljbjfkapdkoienihi
is an ID of React Developer Tools: I verified by opening chrome://extensions/
and performing page search for this ID.
The expected behavior
No errors
Notes
It’s a convoluted usecase, but I thought it may help to catch bugs for more important ones.
I am not sure whether it’s plain-text-ness of the page that is important, but that’s how you can reproduce it.
The hypothesis is that dev tools do not expect HTML tree to disappear on navigation, or either extension enters a state where it cannot digest the plain text pages (and it probably shouldn’t try).
P.S. Thanks for the refreshed extension, it makes dev experience so wonderful! ❤️Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:12 (5 by maintainers)
@hardikmodha This issue is all yours! 😄
I’ve added the “good first issue (taken)” label so that others will know not to start work on the issue. If you change your mind about the issue, no worries! Just let me know so that I can remove the label and free it up for someone else to claim.
Cheers!
Just to clarify, the command is
yarn build:chrome
(no space after the "😊. If you ranyarn build: chrome
it would have failed (which could be the cause of the problem you’re reporting).