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

Uncaught TypeError: Cannot read property 'key' of null #1017

Closed
TrySound opened this issue Apr 7, 2017 · 9 comments
Closed

Uncaught TypeError: Cannot read property 'key' of null #1017

TrySound opened this issue Apr 7, 2017 · 9 comments
Milestone

Comments

@TrySound
Copy link

TrySound commented Apr 7, 2017

And again and again and again...

Observed Behaviour

Inferno is...

Uncaught TypeError: Cannot read property 'key' of null
at patchKeyedChildren (patching.js:421)
at patchChildren (patching.js:200)
at patchElement (patching.js:86)
at patch (patching.js:25)
at patchComponent (patching.js:324)
at patch (patching.js:17)
at patchComponent (patching.js:275)
at patch (patching.js:17)
at patchChildren (patching.js:191)
at patchElement (patching.js:86)

Expected Current Behaviour

Inferno should...

Inferno Metadata

macOS / Windowx / Linux
Safari / Chrome / Firefox / ...

@jmhdev
Copy link

jmhdev commented Apr 7, 2017

@TrySound Have you been able to isolate the component that the error is stemming from? Does this occur on intial render, after a setState, or some other event?

@Havunen
Copy link
Member

Havunen commented Apr 7, 2017

Steps to reproduce missing :(

@TrySound
Copy link
Author

TrySound commented Apr 7, 2017

Yeah, don't have a time yet. I guess I miss key props somewhere.

@LukeSheard
Copy link
Contributor

Any update on a reproduction?

@pomle
Copy link

pomle commented Jun 10, 2017

This seems to happen to me when I .map() over an Immutable.js List.

Error:

const bookings = new List(...);
return <div>
    { bookings.map(b => <span>) }
</div>;

No error:

const bookings = new List(...);
return <div>
    { [...bookings].map(b => <span>) }
</div>;

Attaching error screen from a create-inferno-app project.

screen shot 2017-06-10 at 11 44 49 am

@LukeSheard
Copy link
Contributor

@pomle a small reproduction would be very helpful. I think this might be related to #1103 but without a small reproduction this is hard to isolate.

@pomle
Copy link

pomle commented Jun 10, 2017

@pomle
Copy link

pomle commented Jun 10, 2017

@LukeSheard I think this is the "culprit". It checks if a node is exactly an Array. React supports iterables I believe.

Here's a thread that I think discusses the upgrade of React
facebook/react#2296

@Havunen Havunen added this to the 4.0 milestone Aug 3, 2017
@Havunen
Copy link
Member

Havunen commented Dec 15, 2017

Inferno supports iterables when inferno-compat package is used. This has been like this for long time. I'm closing this as its working as designed.

If we want to bring iterable support into core that is separate discussion and new issue can be created for that.

@Havunen Havunen closed this as completed Dec 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

5 participants