Clojurescript, fulcro and advanced compilation

So I’ve been working through this awesome fulcro book (Fulcro Developers Guide). I’ve managed to get it all working with shadow-cljs (including advanced compilation). But for fun I decided to see if I could get it to work with a bare bones cljs + webpack setup in order to get my head around advanced compilation/externs etc.

So I’ve managed to get it working with regular compilation. However with advanced compilation I get this error:

Uncaught TypeError: Cannot read property 'unstable_cancelCallback' of undefined
    at main.js:2
    at Object.41 (main.js:2)
    at t (main.js:2)
    at main.js:2
    at main.js:2

Seems to that l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler is undefined.

Here’s the code:

(ns cljs-fulcro-demo.client
  (:require
   [com.fulcrologic.fulcro.application :as app]
   [com.fulcrologic.fulcro.components :as comp :refer [defsc]]
   [com.fulcrologic.fulcro.dom :as dom]))

;; (set! *warn-on-infer* true)

(defonce app (app/fulcro-app))

(defsc Root [this props]
  (dom/div "Hello, world!"))

(defn init []
  (app/mount! app Root "app"))

(defn refresh []
  (app/mount! app Root "app")
  (comp/refresh-dynamic-queries! app))

(init)

(comment
  (refresh))

Looks like [com.fulcrologic.fulcro.dom :as dom] is causing the issue.

Here’s a link to my repo (GitHub - andersmurphy/cljs-fulcro-demo)

Any help or pointers on what I’m doing wrong would be greatly appreciated. :thinking:

PS: I feel like the moral of the story is just use shadow-cljs :grinning:

1 Like

Same issue here–but without fulcro AFAIK. Just reagent (or at least react). Builds worked fine until I added webpack to the build, and then I saw the undefined issue on __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.

Ultimately I fixed the problem by excluding the cljsjs versions of react and react-dom in Leiningen dependencies for reagent, and installing react and react-dom using npm.

1 Like