This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-12-19
Channels
- # adventofcode (44)
- # announcements (2)
- # aws (9)
- # beginners (166)
- # braveandtrue (16)
- # calva (170)
- # cider (14)
- # cljdoc (9)
- # cljs-dev (4)
- # cljsrn (1)
- # clojars (1)
- # clojure (150)
- # clojure-dev (15)
- # clojure-europe (4)
- # clojure-india (3)
- # clojure-italy (93)
- # clojure-nl (18)
- # clojure-serbia (1)
- # clojure-spec (5)
- # clojure-uk (45)
- # clojurescript (54)
- # cursive (19)
- # data-science (8)
- # datomic (83)
- # emacs (6)
- # events (1)
- # hoplon (3)
- # hyperfiddle (3)
- # jobs (6)
- # jobs-discuss (1)
- # klipse (1)
- # lein-figwheel (6)
- # leiningen (15)
- # lumo (1)
- # nrepl (1)
- # pedestal (15)
- # re-frame (48)
- # reagent (4)
- # reitit (2)
- # remote-jobs (1)
- # rum (2)
- # shadow-cljs (111)
- # spacemacs (10)
- # sql (16)
- # testing (10)
- # tools-deps (5)
@thheller thanks, I thought so - tracked it down. im just pinning what shadow-cljs uses for deps moving forward
Trying to get a new project set up with shadow-cljs. I always forget, what am I supposed to do when I see this message?
No application has connected to the REPL server. Make sure your JS environment has loaded your compiled ClojureScript code.
After running (shadow.cljs.devtools.api/nrepl-select :app)
.If it's a browser app opening the app in the browser does that for me if I recall correctly
I see all of this output in the console:
shadow-cljs - config: /home/kenny/Forks/bide/shadow-cljs.edn cli version: 2.7.9 node: v6.2.2
WARNING: The org.clojure/clojurescript dependency in shadow-cljs.edn was ignored. Default version is used and override is not allowed to ensure compatibility.
shadow-cljs - starting ...
Dec 18, 2018 4:14:27 PM org.xnio.Xnio <clinit>
INFO: XNIO version 3.3.8.Final
Dec 18, 2018 4:14:27 PM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.3.8.Final
shadow-cljs - server version: 2.7.9
shadow-cljs - server running at
shadow-cljs - socket REPL running on port 33453
shadow-cljs - nREPL server started on port 9009
shadow-cljs - watching build :app
[:app] Configuring build.
[:app] Compiling ...
[:app] Build completed. (141 files, 1 compiled, 0 warnings, 1.27s)
I tried connecting to the url in that output http://localhost:9630 but that doesn't help.You need to visit it before you call nrepl-select I believe, did you try it in that order?
My guess is that's not the correct URL I need to visit. It's not clear what the right URL is though.
https://shadow-cljs.github.io/docs/UsersGuide.html#_connect_the_javascript_environment > For example, for browser development, browse to http://localhost:8080. Where does that URL come from?
Oh ok, you do need to connect to your app. I feel like I usually see another line in there that shows your app's port
I usually run shadow-cljs server
and shadow-cljs watch app
separately if that's any help
All I get from running the former is this:
shadow-cljs server
shadow-cljs - config: /home/kenny/Forks/bide/shadow-cljs.edn cli version: 2.7.9 node: v6.2.2
shadow-cljs - connected to server
server already running
Unfortunately, I haven't yet been able to grok shadow's source code so I'm still in black box land, though getting a bit better
The watch command implicitly starts a server, I just remember being confused by some odd behavior
I have a browser based library that I'd like to open a REPL for -- there's no "app" in the traditional sense.
{:source-paths ["src"]
:dependencies [[org.clojure/clojurescript "1.10.339" :scope "provided"]]
:nrepl {:port 9009}
:builds {:app {:target :browser
:modules {:main {:entries [bide.core]}}}}}
Yeah, from the docs: https://shadow-cljs.github.io/docs/UsersGuide.html#nREPL
shadow-cljs - HTTP server for ":app" available at
Here's where the message comes from: https://github.com/thheller/shadow-cljs/blob/64c74fc5a60dcaebc5be152b447122d64765d5ce/src/main/shadow/cljs/devtools/server/dev_http.clj#L129
Actually I'm not sure if that would do it, but you might try playing with the server options
I added all of the :devtools
stuff
{:source-paths ["src"]
:dependencies [[org.clojure/clojurescript "1.10.339" :scope "provided"]]
:nrepl {:port 9009}
:builds {:app {:target :browser
:modules {:main {:entries [bide.core]}}
:devtools {:http-root "public"
:http-port 3000
:http-handler shadow.http.push-state/handle}}}}
then created an index.html
and added script
tag that loads the main.js file. That seems like a mighty high barrier to starting a browser REPL 🙂 It'd be cool to see that process simplified for cases like this.For sure, though compare to lein-cljsbuild, which is not much simpler, and significantly magicker
Nice! Sorry my process was so slow; @thheller could have gotten you sorted much faster, I'm still learning 🙂
Thanks for the help. This seems like it'd make a fantastic addition to the docs. I'll make a note and, if I have time this weekend, submit a PR.
Hmmm sounds plausible, maybe you could hack it by establishing your own file watcher and calling a rebuild function
Hi. After upgrading to 2.7.9 my release build fails with this error:
TypeError: Cannot read property 'cljs$core$IFn$_invoke$arity$1' of undefined
at $cljs$core$thisfn$$ (mdc.615F7DC4.js:2902)
at Function.cljs.core.key__GT_js.cljs$core$IFn$_invoke$arity$2 (mdc.615F7DC4.js:2897)
at mdc.615F7DC4.js:2901
at $cljs$core$thisfn$$ (mdc.615F7DC4.js:2904)
at Function.cljs.core.clj__GT_js.cljs$core$IFn$_invoke$arity$variadic (mdc.615F7DC4.js:2906)
at Object.cljs.core.clj__GT_js (mdc.615F7DC4.js:2899)
at Object.sablono.interpreter.attributes (back-office.9160B910.js:2201)
at Object.sablono.interpreter.element (back-office.9160B910.js:2203)
at Object.sablono.interpreter.interpret_vec (back-office.9160B910.js:2204)
at cljs.core.PersistentVector.sablono$interpreter$IInterpreter$interpret$arity$1 (back-office.9160B910.js:2205)
at Object.sablono.interpreter.interpret (back-office.9160B910.js:2187)
at Function.<anonymous> (back-office.9160B910.js:9408)
at Function.cljs.core.apply_to_simple.cljs$core$IFn$_invoke$arity$3 (mdc.615F7DC4.js:1400)
at Function.cljs.core.apply_to_simple.cljs$core$IFn$_invoke$arity$2 (mdc.615F7DC4.js:1399)
at Function.cljs.core.apply.cljs$core$IFn$_invoke$arity$2 (mdc.615F7DC4.js:1422)
at $class$$jscomp$6_mixins$$ (back-office.9160B910.js:2685)
at fh (back-office.9160B910.js:112)
at qg (back-office.9160B910.js:140)
at rg (back-office.9160B910.js:141)
at Jd (back-office.9160B910.js:153)
at Sa (back-office.9160B910.js:152)
at sg (back-office.9160B910.js:150)
at Hb (back-office.9160B910.js:148)
at Ag (back-office.9160B910.js:165)
at Qe (back-office.9160B910.js:165)
at sc.render (back-office.9160B910.js:214)
at back-office.9160B910.js:169
at yg (back-office.9160B910.js:164)
at Od (back-office.9160B910.js:169)
at Object.render (back-office.9160B910.js:216)
at Object.rum.core.mount (back-office.9160B910.js:2702)
at Object.my_trees.frontend.back_office.app.start (back-office.9160B910.js:9443)
at Object.my_trees.frontend.back_office.app.init (back-office.9160B910.js:9448)
at (index):1
Have you tried clearing node_modules
? We observed a bunch of weird errors updating to 2.7.8 that went away with an rm -rf
...
Ok. Is there direction you can direct me for investigation please? It seems it has something to dy with keyword creation
not sure. probably hook up JS debugger with pause of exception and try to figure out whats happening
Have you tried clearing node_modules
? We observed a bunch of weird errors updating to 2.7.8 that went away with an rm -rf
...
hi, i’m having problems connecting to shadow-cljs repl from cursive
its trying to run cljs commands in a clj repl
even though i changed the dropdown, anyone else have this?
btw thheller, it’s a fantastic tool 🙂
ah i have to piggyback like in figwheel?
working
is that in the docs somehwere?
i couldn’t find it
is there a trick so i don’thave to type it every time?
Just FYI regarding the funcool/decimal
issue https://github.com/funcool/decimal/issues/7#issuecomment-448576845
thanks
excellent, it’s all working now
thanks 🙂
calva works out of the box
cursive seems more fiddly
@christopher.paul calva as additional support for shadow-cljs. cursive does not (yet)
yea i noticed 🙂
@achikin right;. but you are not calling that fn so it probably should be (js/goog.exportSymbol "Decimal.noConflict" decimal-js/noConflict)
@thheller as far as I can see from the sources of funcool/decimal
(def ^:static +decimal+ (js/Decimal.noConflict))
(def ^:dynamic *decimal* +decimal+)
I need to provide a function, which can be called by decimal.core
> (js/goog.exportSymbol "Decimal" decimal-js)
might also work?
I'm not sure about this one because noConflict depends on the global
environment of javascript...
I've tried some more simple solutions and it appears that noConflict remains empty...
// Export.
if (typeof window !== 'undefined') {
globalScope = window;
} else if (typeof global !== 'undefined') {
globalScope = global;
}
if (!globalScope) {
globalScope = typeof self != 'undefined' && self && self.self == self
? self : Function('return this')();
}
noConflict = globalScope.Decimal;
Decimal.noConflict = function () {
globalScope.Decimal = noConflict;
return Decimal;
};
globalScope.Decimal = Decimal;
})(this);
I think in my case it sets globalScope.Decimal
properly, but not globalScope.Decimal.noConflict
And as soon as funcool
tries to access noConflict
instead of the Decimal
directly - that does not always work properly...
It is very strange $keyword_fn$$
is undefined in the clj->js function definition.