Hi all! I’m trying to get a planck repl working with cursive, I’d like to be able to send code from a cljs namespace in my project to the repl. I feel like I must be missing something pretty simple I can get the cursive repl to connect to planck, and send basic cljs forms to the repl and have them evaluated in the planck repl. However, when I try to require a library in the cljs namespace (e.g. "(ns guestbook.core (:require [reagent.core :as reagent :refer [atom]]))” , I get a “no such namespace error...”. I am starting planck with the -c option: “planck -c src -n 7777”. My directory structure is src clj <project-name> cljc cljs <project-name> core.cljs If you need more info, I’ll post a gist later, but I’m hoping I’m just missing something obvious 🙂
I should have mentioned, when I do lein cljsbuild.. , the same cljs source files compile fine, so I think the dependencies are actually in the project
also, I’m using the instructions here: http://planck-repl.org/ides.html
@ghufran I’d suggest trying it outside of Cursive first, but that doesn’t seem to be a problem. I’m wondering if Reagent works at all in self-hosted ClojureScript, and if the problem is related to that. What is the specific error you get?
ok, so I managed to get planck (outside of cursive) working with a source directory using the instructions at http://planck-repl.org/source-dev.html . I can define a function ‘hello’ in a namespace (‘guestbook.core’), then (require ‘guestbook.core) in planck and then call the function. However, if there are (:require ) forms in the namespace declaration in guestbook.core,then I get an error in planck:
guestbook.core=> (require 'guestbook.core :reload) foo nil guestbook.core=> (hello "foo") "Hello, foo” ;; then added (:require [datascript.core :as ds]) to the guestbook.core namespace declaration. Then when I try it again, I get the following: (require 'guestbook.core) No such namespace: datascript.core, could not locate datascript/core.cljs, datascript/core.cljc, or Closure namespace “datascript.core" (require 'guestbook.core :reload) No such namespace: datascript.core, could not locate datascript/core.cljs, datascript/core.cljc, or Closure namespace "datascript.core" nil cljs.user=>
Do you have datascript in the classpath?
I guess I implicitly expected that planck would be able to magically find it as long as it was in the project.clj and I had called lein deps… 🙂
Planck will indeed honor whatever classpath you pass to it, so it is probably worth taking a peek at that
Sorry for the super noob questions..is there a way to say “use the classpaths used /defined in this leiningen project”?
You can
planck -c`lein classpath`
thanks+++, I will go rtfm.. 🙂
great docs btw!
Thanks. Appreciate it!