This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-12-20
Channels
- # admin-announcements (1)
- # bangalore-clj (4)
- # beginners (176)
- # boot (38)
- # cider (9)
- # clara (1)
- # clojars (9)
- # clojure (290)
- # clojure-belgium (25)
- # clojure-berlin (2)
- # clojure-dusseldorf (10)
- # clojure-italy (1)
- # clojure-russia (141)
- # clojure-sg (1)
- # clojure-spec (40)
- # clojure-uk (38)
- # clojurebridge (19)
- # clojurescript (148)
- # code-reviews (37)
- # community-development (7)
- # cursive (27)
- # datomic (71)
- # editors-rus (3)
- # events (1)
- # heroku (1)
- # hoplon (16)
- # jobs (5)
- # lambdaisland (3)
- # lein-figwheel (211)
- # luminus (3)
- # off-topic (52)
- # om (18)
- # onyx (49)
- # overtone (3)
- # pedestal (48)
- # protorepl (7)
- # rdf (2)
- # re-frame (61)
- # reagent (3)
- # timbre (2)
- # untangled (69)
Hey! So I have an issue with figwheel not picking up the :websocket-url config
In the root of project.clj I have the following:
:cljsbuild {:builds [{:id "web"
:source-paths ["src" "env/dev"
"../../../quantum/src/cljc"
"../../../quantum/src/clj"]
:figwheel {:load-warninged-code true
:websocket-url "ws://<IP>/figwheel-ws"}
:compiler {:output-to "./resources/public/js/web/main.js"
:main "env.ios.main"
:output-dir "./resources/public/js/web"
:optimizations :none
:warnings {:redef-in-file false}}}
It hangs on Figwheel: trying to open cljs reload socket
For the url?
I tried websocket-host as just <IP> and also :js-client-host
but that didn’t help...
I can try that again? Because I just barely pulled out the cljsbuild config from a :dev profile thinking maybe the nestedness was causing issues
Right, I’ve read that
I tried first :websocket-host <IP>
Then :websocket-url ws://<IP>/figwheel-ws”
Haha yes 🙂
Yes e.g. 401.239.144.331 (not the actual IP)
I’m starting it remotely on an AWS instance in the appropriate project directory
sudo LEIN_ROOT=1 lein figwheel web
Port 3449 is open in the security settings, yes
When you say the port set, what does that mean?
Well so there’s the AWS private IP and the elastic IP
I tried setting the :server-ip
to the elastic IP but that failed
{:id "web"
:source-paths ["src" "env/dev"
"../../../quantum/src/cljc"
"../../../quantum/src/clj"]
:figwheel {:load-warninged-code true
:websocket-url ""}
:compiler {:output-to "./resources/public/js/web/main.js"
:main "env.ios.main"
:output-dir "./resources/public/js/web"
:optimizations :none
:warnings {:redef-in-file false}}}
As the client
But server, :figwheel {:server-ip 127.0.0.1}
Trying now
(This is what is has been doing btw)
Yes, that’s what it has been doing — like I said, it seems to have not been picking up the config
sudo LEIN_ROOT=1 lein figwheel web
manually
In the directory where that project.clj is
(Meanwhile I killed figwheel and restarted as per that command, after applying the :figwheel {:server-ip “127.0.0.1”}
edit — maybe it changes things)
I would if it connected 😉
(defproject <PROJECT> "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url ""}
;:git-dependencies [[""]]
:dependencies
[ ...
[org.clojure/tools.analyzer.jvm "0.6.10"]
[reagent "0.6.0-rc" :exclusions [cljsjs/react cljsjs/react-dom cljsjs/react-dom-server]]
[re-frame "0.8.0-alpha11"]]
:plugins [[lein-cljsbuild "1.1.1" ]
[lein-figwheel "0.5.8"]
#_[oubiwann/lein-git-deps "0.0.3" ]]
:clean-targets ["target/"]
:aliases {"dependencies" ["pdo"
"deps,"
"sudo" "npm" "install"
"sudo" "rnpm" "link"
; When encountering a build error,
;
]
"prod-build" ^{:doc "Recompile code with prod profile."}
["do" "clean"
["with-profile" "prod" "cljsbuild" "once" "ios"]
["with-profile" "prod" "cljsbuild" "once" "android"]]}
:figwheel {:server-ip "127.0.0.1"}
:cljsbuild {:builds [{:id "web"
:source-paths ["src" "env/dev"]
:figwheel {:load-warninged-code true
:websocket-url ""}
:compiler {:output-to "./resources/public/js/web/main.js"
:main "env.ios.main"
:output-dir "./resources/public/js/web"
:optimizations :none
:warnings {:redef-in-file false}}}
{:id "ios"
:source-paths ["src" "env/dev"]
:figwheel {:load-warninged-code true :websocket-url ""}
:compiler {:output-to "target/ios/not-used.js"
:main "env.ios.main"
:output-dir "target/ios"
:optimizations :none
:warnings {:redef-in-file false}}}
{:id "android"
:source-paths ["src" "env/dev"]
:figwheel {:load-warninged-code true :websocket-url ""}
:compiler {:output-to "target/android/not-used.js"
:main "env.android.main"
:output-dir "target/android"
:optimizations :none
:warnings {:redef-in-file false}}}]}
:profiles {:dev {:dependencies [[figwheel-sidecar "0.5.0-6"]
[com.cemerick/piggieback "0.2.1"]]
:source-paths ["src" "env/dev"]
:repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}}})
Full project.clj (dependencies elided)
By the way, now trying to connect to <IP>:3449 in the browser says “this site can’t be reached"
(Possibly because of the 127.0.01)
Thanks so much for your help with this by the way! Extremely prompt 👍
Ah… I’m seeing something now… figwheel-sidecar has a different version
Removing that dep and trying again
Ah, okay doing it
Well, after it’s up haha
Also, figwheel has been saying that the :compiler :warnings key isn’t valid
Maybe that’s related?
I press s
Maybe that shadows another warning?
Also, figwheel’s up again (`Prompt will show when Figwheel connects to your application`), but shift-reload in the browser says refused to connect
I’ve always been running figwheel from the elastic IP for this particular project
The client is my laptop connecting to the elastic IP via Chrome
The elastic IP points to the AWS instance on which figwheel is running
It worked before the 127.0.0.1 edit
Right, should be
The browser doesn’t actually load the page at all is what I’m saying
When you say “in the client” you mean in project.clj?
All right, doing that now
Relaunching figwheel
Just a very small index.html I created that references the .js files
Well, possibly one concern is this:
Sorry, trying to pull it up
<html>
<head>
<head>
<!-- <link rel="stylesheet" type="text/css" href="./Fonts/selected-fonts.css"> -->
<!-- <meta name="viewport" content="width=device-width, initial-scale=0.67, maximum-scale=0.67, user-scalable=no"> -->
<!-- <link rel="stylesheet" href="react-virtualized.css"></style> -->
<style type="text/css" id="dynamic"></style>
<style type="text/css" id="default-style">
html, body {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
::-webkit-scrollbar {
display: none;
}
</style>
<!-- <link rel="stylesheet" href="fixed-data-table.css"></style> -->
<!-- "https://bitwiseshiftleft.github.io/sjcl/sjcl.js" -->
<!-- <script type="text/javascript" src="/js/forge.bundle.js"></script> -->
<!-- <script type="text/javascript" src="/js/crypto-aes.js" ></script> -->
<!-- <script src="js/react-0.14.7.js" type="text/javascript"></script> -->
<!-- <script src="js/react-0.14.7.min.js" type="text/javascript"></script> -->
<script src="/js/npm-deps.js"></script>
<!--<script src="js/pdfjs.worker.min.js"></script>-->
<!-- <script src="js/react-dom-0.14.7.min.js" type="text/javascript"></script> -->
<!-- <script src="js/react-infinite.min.js" type="text/javascript"></script> -->
<!-- <script src="js/bitdash.min.js"></script> -->
</head>
<body>
<script>
var React = quantaRNDeps.React;
var ReactNative = quantaRNDeps.ReactNative;
</script>
<div id=root></div>
<script src="/js/web/goog/base.js"></script>
<script src="/js/web/cljs_deps.js"></script>
<script>if (typeof goog == "undefined") console.warn("ClojureScript could not load :main, did you forget to specify :asset-path?");</script>
<script>if (typeof goog != "undefined") { goog.require("figwheel.connect"); }</script>
<!-- If you put this outside of the <body> it might say 'js/document.-body not defined' -->
<!-- <script src="/js/web/main.js"></script> -->
<script>goog.require("env.ios.main");</script>
</body>
</html>
Ignore the crazy number of comments
I was trying to reference just /js/web/main.js
but I was running into an issue with paths, I believe
Something like goog.base couldn’t be found
Sorry, I got a late start on reloading figwheel — should be another 10 sec
Just kidding, it’s done
Yes, now the page loads
"Figwheel: trying to open cljs reload socket"
Server side, no connection either
"Prompt will show when Figwheel connects to your application"
Yup! "Figwheel: trying to open cljs reload socket”
Oh, figwheel isn’t printing out the ip:port combo (That would be nice though)
Doing shift-reload again
Figwheel: trying to open cljs reload socket
and hangs as usual
utils.cljs?rel=1482193632635:49 > Figwheel: trying to open cljs reload socket
Chrome dev tools right? Not some extension I might not have?
Ah, it’s taking very long to print that out
Always does
Like 60 sec or something? Maybe more
Oh now I see it
socket.cljs?rel=1482195136016:63 WebSocket connection to '
Still localhost
Figwheel works like a charm locally but I’ve always run into errors around non-localhost scenarios and just given up
I’m sure it’ll be just fine in a bit 🙂
ok you need to look at the output file /resources/public/js/web/figwheel/connect/web.cljs
All right, going there
I only have connect.cljs
client client.cljs client.cljs.cache.json client.js client.js.map connect.cljs connect.cljs.cache.json connect.js connect.js.map
`(ns figwheel.connect (:require [env.ios.main] [figwheel.client] [figwheel.client.utils])) (figwheel.client/start {:load-warninged-code true, :build-id "web", :websocket-url "ws://[[client-hostname]]:3449/figwheel-ws”})`
How is client-hostname localhost?? When location.host
is "52.4.208.191:3449”
?
Anyway the IP isn’t getting put in
Also let me check my dependency tree to make sure figwheel isn’t being overridden by an earlier version or something...
Yeah heh it doesn’t 😛
I hope I’m doing something wrong, because that would be easier
I had an old version of figwheel (`0.5.4-7` in dependencies, not the 0.5.8
in plugins) which I updated to 0.5.8
And I’ll do the rest
lein clean
done
Got rid of warnings key and trying again with figwheel
I manually cleaned some things just now by the way because they weren’t in clean targets (the js/web directory for instance)
No config errors
Still loading
It’s up but I don’t see figwheel/connect
Before and after shift-reloading I still don’t see it
resources/public/js/web/figwheel
shows client client.cljs client.cljs.cache.json client.js client.js.map
client folder shows
file_reloading.cljs file_reloading.js.map heads_up.js socket.cljs.cache.json utils.cljs utils.js.map
file_reloading.cljs.cache.json heads_up.cljs heads_up.js.map socket.js utils.cljs.cache.json
file_reloading.js heads_up.cljs.cache.json socket.cljs socket.js.map utils.js
Still WebSocket connection to '
Which main file? main.js?
var CLOSURE_UNCOMPILED_DEFINES = null;
if(typeof goog == "undefined") document.write('<script src="./resources/public/js/web/goog/base.js"></script>');
document.write('<script src="./resources/public/js/web/cljs_deps.js"></script>');
document.write('<script>if (typeof goog == "undefined") console.warn("ClojureScript could not load :main, did you forget to specify :asset-path?");</script>');
document.write("<script>if (typeof goog != \"undefined\") { goog.require(\"figwheel.connect.web\"); }</script>");
document.write('<script>goog.require("env.ios.main");</script>');
Yeah this is why I don’t use main.js — I use env.ios.main
directly
Because goog.require(\"figwheel.connect.web\”)
fails
Hmm okay, trying at least
goog.require('figwheel.connect.web’)
-> null
ls
on figwheel directory yields client client.cljs client.cljs.cache.json client.js client.js.map
client
is a folder
No connect
Yes, fixed that though
lein clean
and manually removed the js/web folder
This is why it took 212.987 seconds instead of ~40 😛
Hmm right..
Do I need to have something else as a dependency for figwheel.connect.web to be generated?
Hmm let me try to find if figwheel has a weird interaction via lein deps :tree
It does connect locally (in some sense) — I just always have used figwheel for this project in the context of React Native (re-natal) so I didn’t have to use figwheel’s 3449, just RN’s 8080
But yeah the lack of 3449 connection is the issue here
Which I think will be fixed by fixing dependencies?
If that doesn’t work I’ll come back
But I know where to look now at least
Haha sure 😛 I feel pretty confident about the next step (dependency fixes) and don’t want to take up more of your time but this is a strange enough situation apparently...
I have screenhero
Do you? I can invite you
Cool, what’s your username
Oops, email I guess (you can delete the address from Slack after I put it into Screenhero)
Screenhero doesn’t do lookups by username
Thanks!
It says “invitation sent"
Thanks so much for all your help!