bhauman / lein-figwheel

Figwheel builds your ClojureScript code and hot loads it into the browser as you are coding!
Eclipse Public License 1.0
2.88k stars 208 forks source link

NullPointerException when running figwheel in a cursive clojure REPL #140

Closed aeberts closed 9 years ago

aeberts commented 9 years ago

I was attempting to get a figwheel repl running in a cursive clojure repl.

MacOS 10.10.2 Intellij 14.1 Cursive version 0.1.54) Java 1.8

my project.clj:

(defproject fig-temp "0.1.0-SNAPSHOT"
  :description "FIXME: write this!"
  :url "http://example.com/FIXME"
  :license {:name "Eclipse Public License"
            :url "http://www.eclipse.org/legal/epl-v10.html"}

  :dependencies [[org.clojure/clojure "1.7.0-beta2"]
                 [org.clojure/clojurescript "0.0-3211" :scope "provided"]
                 [figwheel "0.2.9"]
                 [figwheel-sidecar "0.2.9"]
                 [org.clojure/core.async "0.1.346.0-17112a-alpha"]
                 [cljsjs/react "0.13.1-0"]
                 [reagent "0.5.0"]
                 [reagent-forms "0.5.0"]
                 [reagent-utils "0.1.4"]
                 [re-com "0.5.3"]
                 [secretary "1.2.3"]]

  :plugins [[lein-cljsbuild "1.0.5"]
            [lein-figwheel "0.2.9"]]

  :source-paths ["src"]

  :clean-targets ^{:protect false} ["resources/public/js/compiled"]

  :cljsbuild {
    :builds [{:id "dev"
              :source-paths ["src" "dev_src"]
              :compiler {:output-to "resources/public/js/compiled/fig_temp.js"
                         :output-dir "resources/public/js/compiled/out"
                         :optimizations :none
                         :main fig-temp.dev
                         :asset-path "js/compiled/out"
                         :source-map true
                         :source-map-timestamp true
                         :cache-analysis true }}
             {:id "min"
              :source-paths ["src"]
              :compiler {:output-to "resources/public/js/compiled/fig_temp.js"
                         :main fig-temp.core                         
                         :optimizations :advanced
                         :pretty-print false}}]}

  :figwheel {
             :http-server-root "public" ;; default and assumes "resources" 
             :server-port 3449 ;; default
             :css-dirs ["resources/public/css"] ;; watch and update CSS

             ;; Start an nREPL server into the running figwheel process
             :nrepl-port 7888

             ;; Server Ring Handler (optional)
             ;; if you want to embed a ring handler into the figwheel http-kit
             ;; server, this is simple ring servers, if this
             ;; doesn't work for you just run your own server :)
             ;; :ring-handler hello_world.server/handler

             ;; To be able to open files in your editor from the heads up display
             ;; you will need to put a script on your path.
             ;; that script will have to take a file path and a line number
             ;; ie. in  ~/bin/myfile-opener
             ;; #! /bin/sh
             ;; emacsclient -n +$2 $1
             ;;
             ;; :open-file-command "myfile-opener"

             ;; if you want to disable the REPL
             :repl false

             ;; to configure a different figwheel logfile path
             ;; :server-logfile "tmp/logs/figwheel-logfile.log" 
             })

Reproduction Steps:

Connecting to local nREPL server...
Loading /Users/zand/Library/Application Support/IntelliJIdea14/clojure-plugin/lib/cursive.jar!/cursive/repl/runtime.clj... done
Clojure 1.7.0-beta2
nREPL server started on port 63923 on host 127.0.0.1 - nrepl://127.0.0.1:63923
(use 'figwheel-sidecar.repl-api)
=> nil
(cljs-repl)
NullPointerException   clojure.core/deref-future (core.clj:2184)
aeberts commented 9 years ago

Oops. I guess I was looking at the wrong instructions.

I tried the same thing using a Remote repl on port 7888 and the figwheel repl seems to be working fine :-)

bhauman commented 9 years ago

Glad you found it. This is not necessary, but if you have a moment it would be super helpful if there was a figwheel Wiki page with the correct instructions for how to get the REPL working for Cursive. I understand if you aren't able to do it. But this info would be really helpful for people and as of yet I haven't used Cursive.

aeberts commented 9 years ago

Done!

Please don't hesitate to add, modify, destroy, etc.

https://github.com/bhauman/lein-figwheel/wiki/Running-figwheel-in-a-Cursive-Clojure-REPL

On Thu, Apr 30, 2015 at 10:07 PM, Bruce Hauman notifications@github.com wrote:

Glad you found it. This is not necessary, but if you have a moment it would be super helpful if there was a figwheel Wiki page with the correct instructions for how to get the REPL working for Cursive. I understand if you aren't able to do it. But this info would be really helpful for people and as of yet I haven't used Cursive.

— Reply to this email directly or view it on GitHub https://github.com/bhauman/lein-figwheel/issues/140#issuecomment-98022491 .

Alexander Eberts (514) 944 8562

bhauman commented 9 years ago

Absolutely awesome!! Thank you!