-
-
Notifications
You must be signed in to change notification settings - Fork 208
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
fixed NullPointerException and made tests run #112
base: master
Are you sure you want to change the base?
Conversation
Here is some context about the issue I was experiencing before my fix:
This error occurs on Ubuntu 13.10 (and whatever version of Ubuntu I'm running at home) with the following JVM version:
This is the code that reproduces the exceptions for me: (ns server
(:require [clojure.tools.namespace.repl :refer (refresh)]
[cemerick.piggieback :as piggieback]
[weasel.repl.websocket :as weasel]
[environ.core :refer [env]]
[figwheel-sidecar.auto-builder :as fig-auto]
[figwheel-sidecar.core :as fig]
[hermes.gcs :as gcs]
[hermes.state :as state]
[hermes.handler :as handler]))
(defn browser-repl []
(piggieback/cljs-repl :repl-env (weasel/repl-env :ip "0.0.0.0" :port 9001)))
;; FIX: right now, we need to use ther http-kit adapter for Sente
;; in development mode because that is what Figwheel needs, while
;; using Immutant in production-mode because it has better
;; WebSockets support. Obviously, using a single server is preferable,
;; so let's revisit this later.
(defn start-figwheel []
(let [{:keys [bucket state-file key-file service-account-email]} env]
(if (not-any? nil? [bucket state-file key-file service-account-email])
(do
(state/update-state-from-string!
(gcs/get! (:credential @state/config) bucket state-file))
(println "Starting figwheel")
(let [fighwheel-server
(fig/start-server {:http-server-root "public"
:server-port 3449
:css-dirs ["resources/public/css"]
:ring-handler 'hermes.handler/app})
config
{:builds
[{:id "dev"
:source-paths ["env/dev/cljs" "src/cljs"]
:compiler {:main 'hermes.dev
:asset-path "js/out"
:output-to "resources/public/js/app.js"
:output-dir "resources/public/js/out"
:source-map-path "resources/public/js/"
:source-map "resources/public/js/source.map"
:source-map-timestamp true
:optimizations :none
:pretty-print true}}]}]
(fig-auto/autobuild* config)))
(println "Can't start without the following environment variables:"
"BUCKET, STATE_FILE, KEY_FILE, SERVICE_ACCOUNT_EMAIL")))) |
Sorry for not getting back to you on this. I've been a bit busy lately. I'll take a close look at this today. |
👍 |
Again sorry for taking so long.
|
Thanks for your response! Providing a :figwheel-server value does fix the problem for me, so I assume that the fix should probably be to log a warning if it isn't provided. The application does work if the server isn't passed to Figwheel, though! |
I was scanning through some issue and wondering if this is still valid and/or the fix can go in anyways. |
Thanks for that, yes this is out of date and should be closed.
… On Jun 24, 2017, at 10:02 PM, Andrea Richiardi ***@***.***> wrote:
I was scanning through some issue and wondering if this is still valid and/or the fix can go in anyways.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
When integrating Sidecar into my project I ran into some NullPointerExceptions. I wrote a quick fix, which isn't as thorough as it could be, because it fixes the symptom (i.e. the exceptions went away), but doesn't address the root cause (i.e. the atoms not being provided to the relevant functions). Apart from the
atom?
check, I also threw away some broken tests and a duplicate function (norm-path
) in order to make the tests run again.Thanks for the great work on Figwheel and Sidecar! I hope this fix saves someone some time.