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.

TypeError Cannot read property of undefined - selection.js line 24

See original GitHub issue

@AllenFang

First, thanks for the amazing tool, it truly has made our project so much easier having it in our toolbox! Hopefully, we can pay your hard work forward by helping to resolve this bug which possibly relates to three other tickets: #939, #599, and #515

Version Info

  • “react”: “^16.8.6”,
  • “react-dom”: “^16.8.6”,
  • “react-bootstrap-table-next”: “^3.2.0”,
  • “react-bootstrap-table2-editor”: “^1.4.0”,
  • “react-bootstrap-table2-filter”: “^1.2.0”,
  • “react-bootstrap-table2-overlay”: “^2.0.0”,
  • “react-bootstrap-table2-paginator”: “^2.1.0”,
  • “react-bootstrap-table2-toolkit”: “^2.1.0”,

Describe the bug We’re using custom filters via checkboxes to remove rows with one of our specific “label” properties.

While this works perfectly most of the time, we’ve noticed an increasing amount of occurrences on the live instance of our app where clicking a filter checkbox will throw the following error:

TypeError: Cannot read property 'campaignID' of undefined
   at selection.js:25
   at Array.map (<anonymous>)
   at t.getSelectionSummary (selection.js:24)
   at t.value (selection-context.js:208)
   at ga (react-dom.production.min.js:3880)
   at ma (react-dom.production.min.js:3871)
   at Ys (react-dom.production.min.js:6116)
   at zs (react-dom.production.min.js:5101)
   at Bs (react-dom.production.min.js:4958)
   at Ds (react-dom.production.min.js:4817)
   at react-dom.production.min.js:2543
   at t.unstable_runWithPriority (scheduler.production.min.js:338)
   at lo (react-dom.production.min.js:2513)
   at yo (react-dom.production.min.js:2538)
   at ho (react-dom.production.min.js:2528)
   at Rs (react-dom.production.min.js:4865)
   at react-dom.production.min.js:1783
   at HTMLDocument.r (helpers.js:87)
(anonymous) @ breadcrumbs.js:76

Where the campaignID is the key on the row.

To Reproduce Steps to reproduce the behaviour:

  1. Go to one fo the “pages” where the filters exist
  2. Click on a checkbox to filter the tabular data based on the remaining labels
  3. Click on a different checkbox to filter the tabular data again
  4. Repeat N times
  5. See error above

Screenshots If applicable, add screenshots to help explain your problem. image

codesandbox While we would love to create an example on https://codesandbox.io as the site contains live client data this is not able to happen - however, we do have videos of this occurring on our site which we would be happy to share privately at your request.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jonrandahlcommented, Nov 28, 2019

Thanks @kimjavier43 I’ll check those versions on our instance!

0reactions
kimjavier43commented, Nov 28, 2019

Tested working with the latest version.

"react-bootstrap-table-next": "^3.3.1",
"react-bootstrap-table2-paginator": "^2.1.0",
"react-bootstrap-table2-toolkit": "^1.4.2",
Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolving TypeError: Cannot Read Property of Undefined ...
TypeError: Cannot read property of undefined occurs when a property is read or a function is called on an undefined variable.
Read more >
I cannot find the error TypeError: Cannot read properties of ...
Your issue is that your .find() method is returning undefined , so you can't access properties on product such as .name as it...
Read more >
Cannot read properties of undefined (reading 'mData')
How to I fix this? Uncaught TypeError: Cannot read properties of undefined (reading 'mData'). ref my JQuery script: $.
Read more >
Uncaught TypeError: Cannot read property of undefined
Out of the six primitive types defined in JavaScript, namely boolean, string, symbol, number, Null, and undefined, no other type throws as ...
Read more >
app.js:24 Uncaught (in promise) TypeError: Cannot read ...
There error shows that it happened on line 14/24 because that is where the error occurred. It errored on 24 when it tried...
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