Skip to content

[react-devtools-extensions] Bug: Uncaught TypeError: Cannot read property 'sub' of undefined when navigating to plain-text pages #17832

Closed
@ivan-aksamentov

Description

@ivan-aksamentov

React Developer Tools: 4.4.0 f749045 (1/3/2020) from chrome webstore
Chromium: 81.0.4024.0 snapshot
Ubuntu: 18.04

Steps To Reproduce

  1. Open chrome with React Developer Tools installed
  2. Open developer console
  3. 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)
  4. Navigate to a React-enabled website, e.g. https://reactjs.org
  5. 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! ❤️

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions