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.

【Bug】Uncaught TypeError: Cannot read property 'element' of null

See original GitHub issue

Github link

https://github.com/djkloop/vuedraggable-issuse-error.git

Step by step scenario

# Uncaught TypeError: Cannot read property 'element' of null

Actual Solution

# Dragging is normal for the first time, and an error will be reported when dragging back to the original position

Expected Solution

# Can't drag

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:5
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
Spice-Kingcommented, Sep 8, 2021

I flipped it around and used tag="div" :component-data="{ as: 'transition-group' }" and it worked better.

Might not apply here since I’m on Vue 3.2 and Vue.Draggable.Next v4.1, but this thread did give the answers as to stuff about the fatherNode error, so I feel it’s at least worth punting here for the next person. If anyone wants to confirm it in the Vue 2 version, be my guest, I don’t have a Vue 2 app handy.

5reactions
quietmintcommented, Dec 29, 2020

I had the same issue when dragging between two lists if I use tag="transition-group" (but not when I use the default tag="div"). The error indicated that inserting the node failed, something about fatherNode being a text node (so it couldn’t access children).

I fixed it by using tag="transition-group" :component-data="{ tag: 'div' }" to cause <transition-group> to output an actual DOM element.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: Cannot read property of null - iDiallo
This error occurs when you read a property or call a method on a null object . That's because the DOM API returns...
Read more >
Uncaught TypeError: Cannot read property 'value' of null
getElementById can't find an element with the supplied ID, it returns null. So the error is telling you it can't find one of...
Read more >
Solve - Cannot read property 'click' of Null in JavaScript
The "Cannot read property 'click' of null" error occurs when trying to call the click method on a null value. To solve the...
Read more >
How to deal with TypeError: cannot read properties of null
While coding in Javascript, you must have at least once received a Type Error which has the message “cannot read properties of null”....
Read more >
Uncaught TypeError Cannot read property value of null
Uncaught TypeError Cannot read property value of null ... $(document).ready(function(){ var str = document.getElementById("cal_preview").value; ...
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