martinklepsch / tenzing

⚡️ Clojurescript application template using Boot
Eclipse Public License 1.0
403 stars 39 forks source link

Use of undeclared Var cljs.user/start-repl #59

Open binarykitchen opened 8 years ago

binarykitchen commented 8 years ago

Seeing this too everytime I start the REPL while on boot dev

~/D/t/michaelh-sandbox ❯❯❯ boot repl --client                                                             master ◼
cli: option vendors: expected optarg, got [str]
cli: option auto-prefix: expected optarg, got #{kw}
Implicit target dir is deprecated, please use the target task instead.
Set BOOT_EMIT_TARGET=no to disable implicit target dir.
REPL-y 0.3.7, nREPL 0.2.12
Clojure 1.8.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_92-b14
        Exit: Control+D or (exit) or (quit)
    Commands: (user/help)
        Docs: (doc function-name-here)
              (find-doc "part-of-name-here")
Find by Name: (find-name "part-of-name-here")
      Source: (source function-name-here)
     Javadoc: (javadoc java-object-or-class-here)
    Examples from clojuredocs.org: [clojuredocs or cdoc]
              (user/clojuredocs name-here)
              (user/clojuredocs "ns-here" "name-here")
boot.user=> (.log js/console "test")

clojure.lang.Compiler$CompilerException: java.lang.RuntimeException: No such namespace: js, compiling:(/tmp/boot.user8737212468071516672.clj:1:1)
             java.lang.RuntimeException: No such namespace: js
boot.user=> (start-repl)
<< started Weasel server on ws://127.0.0.1:41555 >>
<< waiting for client to connect ... Connection is ws://localhost:41555
Writing boot_cljs_repl.cljs...
 connected! >>
To quit, type: :cljs/quit
nil
cljs.user=> (start-repl)
WARNING: Use of undeclared Var cljs.user/start-repl at line 1 <cljs repl>
#object[TypeError TypeError: cljs.user.start_repl is undefined]
martinklepsch commented 8 years ago

You're calling start-repl twice. In the cljs context, i.e. cljs.user there is no start-repl function.

Also make sure you call start-repl before doing anything involving js/.

binarykitchen commented 8 years ago

oh, right. shouldn't it complain when (start-repl) is being called twice when js/ is involved?

martinklepsch commented 8 years ago

@binarykitchen I'm not sure I understand. Are you suggesting printing a warning when (start-repl) is called while being in a CLJS repl already?

If so I suggest adding an issue to the boot-cljs-repl project. A PR would also be great 👍

binarykitchen commented 8 years ago

yes, a warning like that would be good