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.

Crashing in isOver with empty targetId

See original GitHub issue

Describe the bug I have a connected drop target that is removed from the DOM, once something is dropped on to it.

Now since upgrading to v7.1.0, I’m getting

Uncaught TypeError: Cannot read property '0' of undefined

in the monitor.isOver() call inside the collect function. Somehow, it sees that the collect function is still called one more time, after the drop target has been removed (targetId is undefined).

Interesting

  • Downgrading back to 6.0.0 resolved the issue.
  • Also, using a short setTimeout wrapper around my callback that removed the drop target, resolved the issue.

Any idea what could cause that?

To Reproduce Steps to reproduce the behavior:

  1. Connect a Drop target, call monitor.isOver() in collect
  2. in the target, dispatch an action inside drop(...) that removes the drop target
  3. See error

Expected behavior There is no timing issue with isOver and drop targets can be immediately removed.

Screenshots bildschirmfoto 2019-03-07 um 00 58 04

Desktop (please complete the following information):

  • OS: os x
  • Browser chrome
  • react-dnd / html5 backend 7.1.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
darthtrevinocommented, Mar 7, 2019

This should be fixed by cfrank’s PR in a release today

0reactions
Kadriancommented, Mar 8, 2019

Amazing, guys, thanks @cfrank

Read more comments on GitHub >

github_iconTop Results From Across the Web

GM:HUDDrawTargetID - Garry's Mod Wiki
Called from GM:HUDPaint to draw player info when you hover over a player with your crosshair or mouse. Example. This code will turn...
Read more >
Untitled
... Makinson cowell new york, Agence cupillard roanne 42, If empty php 0, ... thruxton predator exhaust uk, Dock street printing, Mh17 crash...
Read more >
Untitled
Mt coot tha forest, Cid drama 24 feb 2012, Gr 32 nu isover. ... R1-1438s, Blank acrylic fridge magnets uk, Brandon flowers nfl...
Read more >
Untitled
Touching the void amazon, Alarplasty cost thailand, Tvfix darwin, Lg t300 trucos ... Learjet 25 crash, Castello blasche misilmeri, Scriptie wijsbegeerte uu?
Read more >
Diff - platform/frameworks/base - Google Git
Parcel); method public void writeToParcel(android.os.Parcel, int); field public static final int CRASHED = 1; // 0x1 - field public static final android.os.
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