omcljs / om

ClojureScript interface to Facebook's React
6.66k stars 364 forks source link

Incremental rendering in reconcile! throws Index out of bounds #766

Closed petterik closed 8 years ago

petterik commented 8 years ago

Updating om from alpha37 to alpha44, I'm getting Uncaught Error: Index out of bounds in cljs.core/subvec used from om.next/reconcile!: https://github.com/omcljs/om/blob/master/src/main/om/next.cljs#L1832

After doing some printing, I found that (let [update-path (path c)] on line 1829, sets update-path as nil.

Facts about the component c: It does not implement om/IQuery. I'm passing its factory (om/computed {} {..stuff..}). It has local state and updates it with om/update-state!

Will start working on a repro.

wilkerlucio commented 8 years ago

I have this problem too, but I wasn't able to figure out what's causing it. My component that causes it also doesn't implement om/IQuery, and it's on a tree where most of its parents do.

petterik commented 8 years ago

Repro commit here: https://github.com/petterik/om/commit/a989b8691ff4d35d814bc4c6babe003106111da3 Branch: https://github.com/petterik/om/tree/om-766-devcard

petterik commented 8 years ago

om.next/reconcile! does not throw Index out of bounds anymore. Verified on master that has commit 39f68233aab0ef5f38f8e220afed1e7f89190645