# Clojurescript, fulcro and advanced compilation

**URL:** https://clojureverse.org/t/clojurescript-fulcro-and-advanced-compilation/7355
**Category:** How to?
**Created:** [March 15, 2021, 10:38pm UTC](https://clojureverse.org/t/clojurescript-fulcro-and-advanced-compilation/7355 "2021-03-15T22:38:34Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![andersmurphy](https://clojureverse.org/user_avatar/clojureverse.org/andersmurphy/32/1960_2.png) [@andersmurphy](https://clojureverse.org/u/andersmurphy)
#### Post date: [March 15, 2021, 10:38pm UTC](https://clojureverse.org/t/clojurescript-fulcro-and-advanced-compilation/7355/1 "2021-03-15T22:38:34Z")

</div>

So I’ve been working through this awesome fulcro book ([Fulcro Developers Guide](https://book.fulcrologic.com/#_create_your_project)). 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:

```auto
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:

```auto
(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](https://github.com/andersmurphy/cljs-fulcro-demo))

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

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

---

<div class="post-metadata">

### Author: ![ejschoen](https://clojureverse.org/user_avatar/clojureverse.org/ejschoen/32/3702_2.png) [@ejschoen](https://clojureverse.org/u/ejschoen)
#### Post date: [April 18, 2021, 6:35pm UTC](https://clojureverse.org/t/clojurescript-fulcro-and-advanced-compilation/7355/2 "2021-04-18T18:35:49Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![system](https://clojureverse.org/uploads/default/original/2X/5/51079bf9e4b7d9466242c06cf1e43b9f8bd6da14.png) [@system](https://clojureverse.org/u/system)
#### Post date: [October 18, 2021, 6:36am UTC](https://clojureverse.org/t/clojurescript-fulcro-and-advanced-compilation/7355/3 "2021-10-18T06:36:40Z")

</div>

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
