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

Latest clerk errors on notebook analyses, ->hash must be ifn? #375

Closed
sritchie opened this issue Dec 25, 2022 · 1 comment · Fixed by #381
Closed

Latest clerk errors on notebook analyses, ->hash must be ifn? #375

sritchie opened this issue Dec 25, 2022 · 1 comment · Fixed by #381

Comments

@sritchie
Copy link
Collaborator

On https://github.com/mentat-collective/mathbox.cljs, branch sritchie/new_release, when I build my static bundle with bb publish-local I see the following output:

🔬 Analyzing… ->hash must be `ifn?` {:->hash nil, :codeblock {:form (show-sci [mathbox/Mathbox {:style {:height 500px, :width 100%}, :init {:background-color 16777215, :camera-position [3 2 5], :scale 500}} [mb/Cartesian {} [mb/Transform4 {:matrix (let [a (/ (* (:projectionAngle (clojure.core/deref !state)) 2 Math/PI) 360.0)] [1 0 0 (Math/cos a) 0 1 0 0 0 0 1 (Math/sin a) 0 0 0 1])} [mb/Area {:rangeX [-3 1], :rangeY [(* -2 Math/PI) (* 2 Math/PI)], :width 129, :height 65, :channels 4, :expr (fn [emit x y _i _j] (let [r (Math/exp x)] (emit (* r (Math/cos y)) (* r (Math/sin y)) x y)))}] [mb/Surface {:color (:surface (clojure.core/deref !state)), :zBias -0.25}] [mb/Line {:color (:line (clojure.core/deref !state)), :width 4}] [mb/Transpose {:order yxzw}] [mb/Line {:color (:line (clojure.core/deref !state)), :width 4}]]]]), :ns-effect? false, :freezable? true, :no-cache? false, :deps #{nextjournal.clerk/with-viewer mentat.clerk-utils.show/show-sci nextjournal.clerk/mark-presented}, :file /Users/sritchie/.gitlibs/libs/io.github.mentat-collective/clerk-utils/e40cdf79edf45748f5a2c6752c8156b3d240b087/src/mentat/clerk_utils/show.cljc, :id mathbox.examples.math.exponential/anon-expr-5drxcaGZr7zvK46gPq5a5FKTUYBvdG}}
Done in 600.672ms. ✅

This also comes up at the REPL when I save the file containing this form, but only sometimes.

I'm not sure how :->hash nil ends up in there. This is happening on version 5cf3982, and was NOT happening a week ago with the same code, though I haven't done a proper bisection to figure out when this came in.

@mk
Copy link
Member

mk commented Dec 27, 2022

This is a warning, not an error. I believe it happens when there's a cycle in Clerk's dependency graph wich leads to on dependency not having a hash set.

Also can be seen in https://github.com/nextjournal/clerk/blob/6609765bcd64fca51f8fdae0800aa93419bfc058/notebooks/how_clerk_works.clj

->hash must be `ifn?` {:->hash nil, :codeblock {:form (ana/find-location (quote io.methvin.watcher.DirectoryChangeEvent)), :ns-effect? false, :freezable? true, :no-cache? false, :deps #{nextjournal.clerk.analyzer/find-location}, :file src/nextjournal/clerk/analyzer.clj, :id how-clerk-works/anon-expr-5drprLrHeSR2p9YPFsKRNUPd9Ponef}}

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

Successfully merging a pull request may close this issue.

2 participants