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

Cannot set properties of undefined (setting 'parent') #77

Open
mjmeintjes opened this issue Mar 8, 2023 · 2 comments
Open

Cannot set properties of undefined (setting 'parent') #77

mjmeintjes opened this issue Mar 8, 2023 · 2 comments

Comments

@mjmeintjes
Copy link

I just upgraded to the latest version of missionary, and am now getting these errors when one of my flows are cancelled. This is on clojurescript side.

Looking at the code (Ambiguous.cljs:299:43), I can't see where pr is defined.

missionary_utils.cljc:511 TypeError: Cannot set properties of undefined (setting 'parent')
    at Object.missionary$impl$Ambiguous$ready [as ready] (Ambiguous.cljs:299:43)
    at Function.G__234226__0 [as cljs$core$IFn$_invoke$arity$0] (Ambiguous.cljs:330:28)
    at missionary$impl$Ambiguous$transfer (Ambiguous.cljs:251:8)
    at Object.eval [as cljs$core$IDeref$_deref$arity$1] (Ambiguous.cljs:11:19)
    at Object.cljs$core$_deref [as _deref] (core.cljs:688:12)
    at Object.cljs$core$deref [as deref] (core.cljs:1477:4)
    at Object.missionary$impl$Ambiguous$backtrack [as backtrack] (Ambiguous.cljs:33:8)
    at Object.missionary$impl$Ambiguous$branch [as branch] (Ambiguous.cljs:73:8)
    at Object.missionary$impl$Ambiguous$ready [as ready] (Ambiguous.cljs:307:44)
    at Function.G__234223__0 [as cljs$core$IFn$_invoke$arity$0] (Ambiguous.cljs:323:28)
@leonoel
Copy link
Owner

leonoel commented Mar 8, 2023

do you have a repro ?

@mjmeintjes
Copy link
Author

[missionary/missionary "b.27"]

scratch.cljs

(ns main.scratch
  (:require [missionary.core :as ms]))
(comment
  (do
    (def input! (atom true))
    (def task
      (ms/reduce
       (constantly nil)
       (ms/ap
        (let [visible? (ms/?< (ms/watch input!) )]
          (println visible?)
          (if visible?
            (try
              (ms/?> (ms/ap
                      (let [n (ms/?> (ms/seed (range 100)))]
                        (ms/? (ms/sleep 1000))
                        (println "TICK: " n))))
              (catch missionary.Cancelled e
                (ms/amb>)))
            nil)))))
    (when (resolve 'cancel) (cancel))
    (def cancel (task println #(js/console.error %))))

  ;; wait a moment, then run
  (reset! input! false)

;; VM1246:400 TypeError: Cannot set properties of undefined (setting 'parent')
;;     at Object.missionary$impl$Ambiguous$ready [as ready] (Ambiguous.cljs:299:43)
;;     at Function.G__17106__0 [as cljs$core$IFn$_invoke$arity$0] (Ambiguous.cljs:330:28)
;;     at missionary$impl$Ambiguous$transfer (Ambiguous.cljs:251:8)
;;     at Object.eval [as cljs$core$IDeref$_deref$arity$1] (Ambiguous.cljs:11:19)
;;     at Object.cljs$core$_deref [as _deref] (core.cljs:688:12)
;;     at Object.cljs$core$deref [as deref] (core.cljs:1477:4)
;;     at Object.missionary$impl$Ambiguous$backtrack [as backtrack] (Ambiguous.cljs:33:8)
;;     at Object.missionary$impl$Ambiguous$branch [as branch] (Ambiguous.cljs:73:8)
;;     at Object.missionary$impl$Ambiguous$ready [as ready] (Ambiguous.cljs:307:44)
;;     at Function.G__17103__0 [as cljs$core$IFn$_invoke$arity$0] (Ambiguous.cljs:323:28)

  )

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