Fork me on GitHub
Sam Ritchie18:03:04

@borkdude NPE for you…

Encountered error when macroexpanding sci.core/copy-ns.
NullPointerException: Cannot invoke "clojure.lang.IFn.invoke(Object)" because the return value of "clojure.lang.Var.getRawRoot()" is null
	sci.core/copy-ns (core.cljc:376)
	sci.core/copy-ns (core.cljc:336)
	clojure.core/apply (core.clj:671)
	clojure.core/apply (core.clj:662)

Sam Ritchie18:03:31

This happens with

(ns demo.viewers
  (:require [demo.mathbox]
            [nextjournal.clerk.sci-viewer :as sv]
            [sci.core :as sci]))

 {:namespaces {'demo.mathbox
               (sci/copy-ns demo.mathbox (sci/create-ns 'demo.mathbox))}})

(defn cake [x]
  (* x x))
trying to narrow it down, then I’ll paste demo.mathbox

Sam Ritchie18:03:18

the target namespace is very simple:

Sam Ritchie18:03:22

(ns demo.face)
(defn square [x] (* x x))

Sam Ritchie18:03:37

Seems like cljs-ns-publics is null:

(def ^:private cljs-ns-publics
    (try (resolve 'cljs.analyzer.api/ns-publics)
         (catch #?(:clj Exception
                   :cljs :default) _ nil)))


Hi. I'm going to read this now.


Can you make a repro?

Sam Ritchie19:03:17

yes, will try and do it today

Sam Ritchie15:03:28

I didn't forget, just scrambling for these talk preps!


:thumbsup: ! I'm also preparing a talk!


But I'm procrastinating a lot on it...

Sam Ritchie15:03:29

Saw your tweet, that's why we're so productive

Sam Ritchie15:03:47

I got shanghai-Ed into giving THREE at this conference


lol, what conf is it?

Sam Ritchie15:03:02

<programming> in Portugal (keynote) and European Lisp Symposium, collocated, doing a keynote and “guts of sicmutils” talk

Sam Ritchie15:03:11

Your work will get a shoutout, multiple shoutouts

Sam Ritchie08:03:34

@borkdude I went to make a repro of this, and some combo of deleting out and friends got this error to go away

Sam Ritchie08:03:40

so now I am a happy user of copy-ns

Sam Ritchie08:03:18

Do you think I should replace anything in here with copy-ns? I don’t think it existed at that time