This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-03-27
Channels
- # aws (8)
- # beginners (172)
- # boot-dev (4)
- # cider (16)
- # cljs-dev (123)
- # cljsjs (4)
- # clojure (90)
- # clojure-brasil (3)
- # clojure-dev (7)
- # clojure-dusseldorf (1)
- # clojure-finland (1)
- # clojure-italy (59)
- # clojure-russia (3)
- # clojure-seattle (2)
- # clojure-seattle-old (1)
- # clojure-spec (40)
- # clojure-uk (28)
- # clojurescript (327)
- # clojurewerkz (3)
- # code-reviews (8)
- # cursive (4)
- # datomic (24)
- # editors (1)
- # emacs (19)
- # fulcro (147)
- # funcool (1)
- # graphql (1)
- # hoplon (34)
- # jobs-rus (1)
- # lein-figwheel (5)
- # leiningen (20)
- # luminus (14)
- # midje (1)
- # off-topic (8)
- # onyx (7)
- # parinfer (47)
- # pedestal (1)
- # perun (1)
- # portkey (46)
- # re-frame (25)
- # reagent (9)
- # remote-jobs (4)
- # ring-swagger (5)
- # rum (1)
- # shadow-cljs (113)
- # slack-help (8)
- # spacemacs (7)
- # sql (9)
- # tools-deps (23)
- # uncomplicate (3)
- # unrepl (3)
- # yada (6)
Hmm, running shadow@latest with [com.google.javascript/closure-compiler-unshaded "v20180101"]
(to avoid that nasty bug, https://github.com/google/closure-compiler/issues/2822) I am getting:
[:browser] Compiling ...
[2018-03-27 14:51:57 - WARNING] Skipping pass rewriteScriptsToEs6Modules
[2018-03-27 14:52:05 - WARNING] failed to handle server msg: {:type :start-autobuild}
java.lang.NoSuchFieldError: STRICT_MISSING_PROPERTIES
at cljs.closure__init.load(Unknown Source)
at cljs.closure__init.<clinit>(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at clojure.lang.RT.classForName(RT.java:2204)
at clojure.lang.RT.classForName(RT.java:2213)
at clojure.lang.RT.loadClassForName(RT.java:2232)
at clojure.lang.RT.load(RT.java:450)
at clojure.lang.RT.load(RT.java:426)
at clojure.core$load$fn__6548.invoke(core.clj:6046)
at clojure.core$load.invokeStatic(core.clj:6045)
at clojure.core$load.doInvoke(core.clj:6029)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5848)
at clojure.core$load_one.invoke(core.clj:5843)
at clojure.core$load_lib$fn__6493.invoke(core.clj:5888)
at clojure.core$load_lib.invokeStatic(core.clj:5887)
at clojure.core$load_lib.doInvoke(core.clj:5868)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:659)
at clojure.core$load_libs.invokeStatic(core.clj:5925)
at clojure.core$load_libs.doInvoke(core.clj:5909)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:659)
at clojure.core$require.invokeStatic(core.clj:5947)
at clojure.core$require.doInvoke(core.clj:5947)
at clojure.lang.RestFn.invoke(RestFn.java:2088)
at cljs.repl$loading__5569__auto____6019.invoke(repl.cljc:9)
now, trying out using devtools.api/watch
:
Exception in thread "main" java.lang.AssertionError: Assert failed: (map? http)
at shadow.cljs.devtools.server.worker$start.invokeStatic(worker.clj:103)
at shadow.cljs.devtools.server.worker$start.invoke(worker.clj:103)
at shadow.cljs.devtools.server.supervisor$start_worker.invokeStatic(supervisor.clj:27)
at shadow.cljs.devtools.server.supervisor$start_worker.invoke(supervisor.clj:18)
at shadow.cljs.devtools.api$get_or_start_worker.invokeStatic(api.clj:85)
at shadow.cljs.devtools.api$get_or_start_worker.invoke(api.clj:76)
at shadow.cljs.devtools.api$watch.invokeStatic(api.clj:102)
at shadow.cljs.devtools.api$watch.invoke(api.clj:88)
at shadow.cljs.devtools.api$watch.invokeStatic(api.clj:92)
at shadow.cljs.devtools.api$watch.invoke(api.clj:88)
at web3.build.build$watch.invokeStatic(build.clj:57)
at web3.build.build$watch.invoke(build.clj:49)
at web3.build.build$watch.invokeStatic(build.clj:52)
at web3.build.build$watch.invoke(build.clj:49)
attempted to add [org.clojure/clojurescript "1.10.145" :exclusions [com.google.javascript/closure-compiler-unshaded]]
, but then I get the java.lang.NoSuchFieldError: STRICT_MISSING_PROPERTIES
error again
i see this is an existing issue, https://github.com/thheller/shadow-cljs/issues/225
@mhuebert the problem unfortunately is in cljs.closure
. why are you pinning a specific closure version again?
i was trying to get the new :shadow/requires-server
thing without the latest clojure version
oh wait .. you ran into this https://github.com/google/closure-compiler/issues/2822 right?
you can "fix" this by copying the https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/closure.clj into your classpath
eg. https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/closure.clj#L151
we don't actually use cljs.closure
at all .. problem is that cljs.repl
imports it though
@mhuebert try [email protected]
. should use the latest cljs version and hopefully let you use the closure v20180101
I really like this setup. Now I have a single watch
command which first compiles the necessary static assets (hiccup->html, garden->css) and then starts the shadow watch process
I am encountering the Error: Could not find or load main class clojure.main
error when following the doco, there's obviously something that I've missed
I have a hello world app with the following shadow-cljs.edn:
{:source-paths ["src"]
:dependencies []
:builds {:server {:target :node-script
:main server.main/main!
:output-to "target/main.js"}}}
and a file ./src/server/main.cljs
(ns server.main
(defn main! [& cli-args]
(prn "hello world"))
I am invoking shadow-cljs compile server
, and shadow-cljs -v
returns: shadow-cljs - config: /var/app/shadow-cljs.edn version: 2.2.20
@sleepyfox can you paste the output of npx shadow-cljs clj-repl
? the error looks like there is no clojure on the classpath which is very weird
exactly the same error:
shadow-cljs - config: /var/app/shadow-cljs.edn version: 2.2.20
shadow-cljs - starting ...
Error: Could not find or load main class clojure.main
if it happens again please post the output of shadow-cljs --cli-info
(before deleting anything)
I suspect it was something to do with the environment, I've been creating a Docker image to try this stuff out in and it's possible an older jvm or node vm may have been causing an issue.
shadow-cljs -d org.clojure/tools.nrepl:0.2.13 -d cider/cider-nrepl:0.17.0-SNAPSHOT server
the -d options does not seem to work when :lein true
is enabled is this expected?@sleepyfox are you creating a docker image that saves the .shadow-cljs
directory but not ~/.m2
?
Btw I am trying it out without leiningen since cider added shadow-cljs support ^^
I'll mount the src, target and other files independently instead of just using COPY . /var/app
I never tried running shadow-cljs in docker. I could add a safeguard to test whether the classpath files still exist and if not invalidate the classpath and regenerate
hi i just upgraded to 2.2.20 and I’m getting an error, I couldn’t determine if it had something to do with what you guys have been discussing
Exception in thread "main" java.lang.ClassNotFoundException: com.google.javascript.jscomp.CompilerInput$ModuleType, compiling:(shadow/build/cljs_closure.clj:3:1)
Did a --cli-info everything looks right
=== Version
cli: 2.2.20
jar-version: 2.2.20
config-version: 2.2.20
@eoliphant do you have a specific closure-compiler version picked in your deps? or clojurescript for that matter?
unfortunately clojurescript is very picky about which closure-compiler version gets used
Hmm I want to use standalone shadow-cljs but duplication all deps from leiningen is too painfull how do other people handle this? Or do they just use leiningen?
I think for now that can't be helped since cursive doesn't look at shadow-cljs.edn
😞
@eoliphant which clojurescript and closure versions are mentioned in --cli-info
?
umm neither lol
MacBook-Pro:fm-ng-ui ericholiphant$ shadow-cljs --cli-info
shadow-cljs - config: /Users/ericholiphant/projects/fm-ng-ui/shadow-cljs.edn version: 2.2.20
=== Version
cli: 2.2.20
jar-version: 2.2.20
config-version: 2.2.20
=== Paths
cli: /Users/ericholiphant/projects/fm-ng-ui/node_modules/shadow-cljs/cli/dist/shadow.cljs.npm.cli.js
config: /Users/ericholiphant/projects/fm-ng-ui/shadow-cljs.edn
project: /Users/ericholiphant/projects/fm-ng-ui
cache: .shadow-cljs
=== Java
java version "1.8.0_152"
Java(TM) SE Runtime Environment (build 1.8.0_152-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.152-b16, mixed mode)
=== Source Paths
=== Dependencies
cache-file: /Users/ericholiphant/projects/fm-ng-ui/.shadow-cljs/classpath.edn
ah ok 🙂 clojure is just 1.9.0, there’s no explicit dependency for closure. In looking at the resolved dependencies in intellij, closure is v20170910
hmm try bumping clojurescript to 1.10.238
... the shadow.build.cljs-closure
ns was added today to work around a different problem with CLJS+Closure
@mitchelkuijpers do you know the lein
command line to inject stuff? can't find it
nvm ... found it https://github.com/technomancy/leiningen/blob/master/src/leiningen/update_in.clj#L34
update-in :dependencies conj \[org.clojure/tools.nrepl\ \"0.2.13\"\ \:exclusions\ \[org.clojure/clojure\]\] -- update-in :plugins conj \[refactor-nrepl\ \"2.4.0-SNAPSHOT\"\]
Oh you found it already
you don't need that
refactor-nrepl only works for clojure not clojurescript
hmm but it seems like you could just stick to lein
? not really worth pretending to use shadow-cljs
which then just delegates to lein
Yeah but we have some trouble when running shadow in leiningen within our repl instead of running it standalone
The shadow-cljs integration in cider works pretty slick
But maybe I should just fix our project somehow
and only one at a time so you are pretty much forced into lein when you want actual clojure support
Yeah but cider is making nice progress, i can now only run shadow-cljs without leiningen ^^
Just duplicated all of our deps in shadow-cljs.edn and it just works
Hmm cannot upload images to slack anymore...
A lazy persons bug report. Not sure if anyone uses moment.js regularly, probably closure bug, but the npm module for moment.js requireing it like this
["moment" :as Moment]
and give it a timestamp
(str (Moment "2018-10-03 18:48:05.123")) produces nicely human readable date
but after compilation (guessing npm modules go trough :simple optimizations)
the timestamp becomes unix timestamp (ex. 1522141700340)
Someone else experienced something similar. Too busy tonight to open ticket, but can do so this weekend.