threeagent icon indicating copy to clipboard operation
threeagent copied to clipboard

:octahedron runtime error

Open dpetranek opened this issue 1 year ago • 0 comments

When I try to draw an octahedron I get the following runtime error:

Uncaught TypeError: module$node_modules$three$build$three_cjs.Octahedron is not a constructor

Here's my setup:

(defn threeagent-root
  []
  [:object
   [:ambient-light {:intensity 1.50}]
   [:box {:position [2 2 -5]}]
   [:dodecahedron
    {:position [0 0 -5]
     :radius 1}]
   [:octahedron
    {:position [-1 -2 -5]
     :radius 1}]])

(defn threeagent-scene
  [root-fn]
  (let [ref (react/createRef)]
    (r/create-class
      {:display-name "threeagent"
       :reagent-render (fn [] [:canvas {:ref ref}])
       :component-did-mount (fn [_] (th/render root-fn (.-current ref)))
       :component-did-update (fn [_] (th/render root-fn (.-current ref)))})))

(defn root
  []
  [:div
   [:h4 "Embedded Threagent Scene"]
   [threeagent-scene threeagent-root]])

(defn ^:dev/after-load init
  []
  (rdom/render root (.getElementById js/document "app")))

I'm using the following: shadow-cljs 2.25.2 threeagent 1.0.1 three 0.152.0

I've also tried with the newest version of three, 0.155.0, with the same result.

dpetranek avatar Aug 16 '23 05:08 dpetranek