Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in bindConnectorMethod #261

Closed
brigand opened this issue Aug 9, 2015 · 9 comments
Closed

Error in bindConnectorMethod #261

brigand opened this issue Aug 9, 2015 · 9 comments
Labels

Comments

@brigand
Copy link

brigand commented Aug 9, 2015

I'm getting this error in shallowEqual from bindConnectorMethod where it expects currentOptions to be an object, but it's undefined.

It doesn't appear to impair functionality (dragging is a bit glitchy but maybe unrelated), and only happens when inserting a new item.

(Object.keys) Uncaught TypeError: Cannot convert undefined or null to object

image

Any tips on how to narrow it down to a repro case?

I'd like to add a better error message once I figure it out, assuming it's not an actual bug.

Full stack trace.

Edit:
Caused by this diff: https://gist.github.com/brigand/facd66d909216e6df714
Backend: HTML5Backend

@gaearon gaearon added the bug label Aug 15, 2015
@marudor
Copy link

marudor commented Aug 17, 2015

I've got the same Issue in my Project. I worked around it by using the shallowEqual Library instead of the shallowEqual in reactDnD.
Main Problem seems to be the a === b check in the shallowEqual.
a is undefined while b is null.

@gaearon any reason to shallowEqual instead of shallowEqualScalar (or the shallowEqual npm module)
Just changing that worked for me. See my Fork (https://github.com/marudor/react-dnd)

@gaearon
Copy link
Member

gaearon commented Aug 18, 2015

I'd appreciate a runnable example reproducing this.

@marudor
Copy link

marudor commented Sep 15, 2015

For me your latest change (1.1.6) fixed this.
I assume due to your Change in dnd-core.

@gaearon
Copy link
Member

gaearon commented Sep 15, 2015

Interesting. I'll close for now; please reopen if you have a reproducible example.

@gaearon gaearon closed this as completed Sep 15, 2015
@marudor
Copy link

marudor commented Oct 20, 2015

Okay, this is still an Issue.
Sadly I still have no real small example to show you. Only able to reproduce it in our company app which I can't share.
It is fixed by my scoped release (I just change your shallowEqual implementation with the shallowequal npm package)

Any reason you're using your own instead of the npm package?
I guess using your shallowEqualScalar method everywhere would also work.

@gaearon
Copy link
Member

gaearon commented Oct 20, 2015

shallowEqualScalar implements completely different logic from shallowEqual.
It returns false if either value is object, which is the opposite of the effect I want here.

@gaearon gaearon reopened this Oct 20, 2015
@gaearon
Copy link
Member

gaearon commented Oct 20, 2015

Should be fixed in 2.0.1.

@gaearon gaearon reopened this Oct 20, 2015
@gaearon gaearon closed this as completed Oct 20, 2015
@gaearon gaearon reopened this Oct 20, 2015
@gaearon gaearon closed this as completed Oct 20, 2015
gaearon added a commit that referenced this issue Oct 20, 2015
@gaearon
Copy link
Member

gaearon commented Oct 20, 2015

Actually you should use 2.0.2, it includes a more correct fix.

@marudor
Copy link

marudor commented Oct 21, 2015

Thanks, looks fixed to me. (Although I just quickly checked, I will tell you if I encounter this again)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants