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

set-query! fails when the component's query has been nested deeper than the top level in the parent's query #874

Open
symfrog opened this issue Jun 11, 2017 · 1 comment

Comments

@symfrog
Copy link

symfrog commented Jun 11, 2017

Using set-query! in a component when the component's query has been nested deeper than the top level in the parent's query results in the following error:

Uncaught TypeError: Cannot read property 'call' of null
    at clojure$zip$node (zip.cljs?rel=1496865979076:62)
    at om$next$cascade_query (next.cljc?rel=1496865999367:1677)
    at om$next$build_index_STAR_ (next.cljc?rel=1496865999367:1761)
    at om$next$build_index_STAR_ (next.cljc?rel=1496865999367:1766)
    at om$next$build_index_STAR_ (next.cljc?rel=1496865999367:1766)
    at om.next.Indexer.om$next$protocols$IIndexer$index_root$arity$2 (next.cljc?rel=1496865999367:1802)
    at om$next$protocols$index_root (protocols.cljc?rel=1496865983284:5)
    at om.next.Reconciler.om$next$protocols$IReconciler$reindex_BANG_$arity$1 (next.cljc?rel=1496865999367:2457)
    at om$next$protocols$reindex_BANG_ (protocols.cljc?rel=1496865983284:19)
    at Function.om.next.set_query_BANG_.cljs$core$IFn$_invoke$arity$3 (next.cljc?rel=1496865999367:1320)

I have created a minimal case using 1.0.0-beta1.

Everything (mutations, path metadata, component refresh etc.) works correctly in the subcomponent, except for dynamic queries and the use of set-query! in the subcomponent. If the call to update-query! on line 23 (https://gist.github.com/symfrog/75bf8955722b26cd4370989dace60e2e#file-placeholders-cljs-L23) is removed, then the issue does not occur.

A recording is available, note the error in the console.

@symfrog symfrog changed the title set-query! fails in a component when the component's query has been nested in the parent's query set-query! fails when the component's query has been nested deeper than the top level in the parent's query Jun 11, 2017
@stevebuik
Copy link

I just hit this as well using set-query!

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

No branches or pull requests

2 participants