I want to use figwheel to experiment with external js library (tensorflow.js). How to do it?
What I tried:
I tried running clojure -A:fig:build, which runs a REPL. But I can't import js/tf in it - it tells me that tf isn't defined (also when I try to require it, (:require [cljsjs.tfjs]) throws ReferenceError: cljsjs is not defined
That's weird given that my core.clj seems to import it and doesn't throw any errors:
(ns ^:figwheel-hooks hello-world.core
(:require [reagent.core] [cljsjs.tfjs]))
(def t (.tensor js/tf (clj->js [1 2 3])))
(defn my-component []
[:p "My first React component"])
(defn ^:export main []
(reagent.core/render
[my-component]
(.getElementById js/document "app")))
(main)
First of all, thank you guys for your great work!
I want to use figwheel to experiment with external js library (tensorflow.js). How to do it?
What I tried:
I tried running
clojure -A:fig:build
, which runs a REPL. But I can't import js/tf in it - it tells me that tf isn't defined (also when I try to require it,(:require [cljsjs.tfjs])
throwsReferenceError: cljsjs is not defined
That's weird given that mycore.clj
seems to import it and doesn't throw any errors:My `deps.edn
What's happening? Does my
core.clj
file actually run? If not, how to make it run?