I'm trying to switch from lein-figwheel to figwheel-main. It now compiles my cljs using the settings in figwheel-main.edn and dev.cljs.edn. However, the websocket keeps disconnecting:
[goog.net.WebSocket] Opening the WebSocket on
[goog.net.WebSocket] WebSocket opened on
[goog.net.WebSocket] The WebSocket on closed.
[goog.net.WebSocket] The WebSocket disconnected unexpectedly: undefined
How do I begin investigating this error? There's no error to be found anywhere that I've been able to spot.Note that it seems to be able to connect, but then immediately disconnects.
This is using:
[com.bhauman/figwheel-main "0.2.16"]
[cider/piggieback "0.5.3"]
[nrepl "0.9.0"]
:repl-options {:nrepl-middleware [cider.piggieback/wrap-cljs-repl]}
In case that is of any use.My figwheel-main.edn is nothing special:
{:open-url false
:open-file-command "emacsclient"
:watch-dirs ["src"]
:css-dirs ["resources/public/css"]}Same goes for dev.cljs.edn:
{:main no-adventur.ui.director
:optimizations :none
:pretty-print true
:source-map true
:asset-path "/js/compiled/out"
:output-to "resources/public/js/compiled/adventur.js"
:output-dir "resources/public/js/compiled/out"
:foreign-libs [{:file "public/js/slip.js" :provides ["slip"]}]}I'm starting figwheel in the repl with:
(figwheel.main/start "dev")Which results in a happy compiler and a properly built set of js-files.
The ws-server gives:
HTTP/1.1 101 Switching Protocols
So it is able to reach it, but possibly not on the new protocol? Unexpected disconnects are pretty expected at this point. 🙃
I am now investigating dependency clashes.
I have now been able to fix this issue. I'll report back when I find which dependency was the culprit.
For posterity: The culprit turned out to be `[ring "1.7.1"]` . This collided with figwheel-main's `1.9.1` of the same library, and in turn jetty and jetty's websocket implementation.
Edit 30 minutes later: I have been able to fix this. Will report back when I figure out which dependency was the culprit. duckie
The culprit turned out to be [ring "1.7.1"] . This collided with figwheel-main's 1.9.1 of the same library, and in turn jetty and jetty's websocket implementation.
Going from 4 separate builds to a single figwheel-main build with 3 :extra-main-files 😍
Seems clashes with jetty are common here