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.

Can not read property ownerDocument of null

See original GitHub issue

I am getting TypeError: Cannot read property 'ownerDocument' of null even if all the required props are passed to Container and element.

Line Number: 429 File: SortableContainer/index.js

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:7
  • Comments:7

github_iconTop GitHub Comments

22reactions
freshcoatcommented, Jun 14, 2019

You have to wrap your items with an element;

error;

indexes.map((index: number) => (
   <div key={`${name}-${index}`}>
      ...
   </div>
))

Fix;

<div>
   {indexes.map((index: number) => (
     <div key={`${name}-${index}`}>
       ...
     </div>
   ))}
</div>
6reactions
dougmartincommented, Aug 24, 2020

One other thing to look out for - if you wrap an element whose render exits early and returns undefined/null when there are no items you’ll also get this error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: Cannot read property 'ownerDocument ...
I think my view is returning proper JSON but now data is not being added to the .mainContent div. It gives this error:...
Read more >
Cannot read property 'ownerDocument' of undefined - Laracasts
I put a child component called <page-buttons> in my main Vue component. This component has some buttons floating on the page.
Read more >
cannot read properties of null (reading 'ownerdocument')
I am getting TypeError: Cannot read property 'ownerDocument' of null even if all the required props are passed to Container and element. Line...
Read more >
Cannot read property ownerDocument of null - Mendix Forum
actionButton2: Cannot read property 'ownerDocument' of null Error: An error occurred while executing On click at Linegenix.Location_NewEdit.
Read more >
Cannot read property 'ownerDocument' of undefined
on refresh the page error is not showing anymore and Grid is coming as expected. Error : Uncaught TypeError: Cannot read property 'ownerDocument ......
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