question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

React Developer Tools: 4.4.0 f749045a5 (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! ❤️

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
bvaughncommented, Jan 15, 2020

@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!

0reactions
bvaughncommented, Jan 16, 2020

Just to clarify, the command is yarn build:chrome (no space after the "😊. If you ran yarn build: chrome it would have failed (which could be the cause of the problem you’re reporting).

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read properties of undefined (reading 'map')
I had the same error and solved it by first asking if the array existed. Example: <Filter> { product.color?.map((c) => ( <FilterColor color ......
Read more >
Urgent: Cannot read properties of undefined (reading 'pay')
I keep getting the errors: Cannot read properties of undefined (reading 'pay'). On iphone I get another, weird error that's similar.
Read more >
Bug Uncaught TypeError: Cannot read property 'lang' of ...
But I found I have this bug Uncaught TypeError: Cannot read property 'lang' of undefined on the product page. Uncaught TypeError: Cannot read ......
Read more >
Cannot read property 'a' of undefined when approving host
Description of problem: when a host is added to the engine using vdsm-tool register, approving that host in the UI is throwing the...
Read more >
React TypeError: Cannot read property function of undefined
Your browser can't play this video. Learn more. Switch camera ... Solved: React TypeError : Cannot read property function of undefined.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found