Fork me on GitHub

on running kaocha-cljs2 in the client side of an electron app I get this error:

test.js:1661 An error occurred when loading lambdaisland.chui.remote.js
env.evalLoad @ test.js:1661
test.js:1662 Error: Failed to construct 'WebSocket': The URL 'ws://:44220' is invalid.
    at (/js/cljs-runtime/
    at Object.lambdaisland$funnel_client$websocket$open_BANG__STAR_ [as open_BANG__STAR_] (/js/cljs-runtime/lambdaisland.funnel_client.websocket.js:163)
    at eval (/js/cljs-runtime/lambdaisland.funnel_client.websocket.js:167)
    at Object.lambdaisland$funnel_client$websocket$ensure_websocket [as ensure_websocket] (/js/cljs-runtime/lambdaisland.funnel_client.websocket.js:41)


my first time trying to run kaocha so probably something I'm fucking up


I fixed it I think, reading the repos there's some environment based inference to determine the URL and the electron renderer process seems to fall all the way through and end up at an invalid url for the websocket, thankfully some legend allowed an override already with a goog/define element, so I could fix it by putting :closure-defines {lambdaisland.funnel-client/FUNNEL_URI "<ws://localhost:44220>"} inside my shadow-cljs map for the build. Writing here in case it saves a future person a minute or so, dear future person - you're welcome