This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-09
Channels
- # announcements (3)
- # asami (1)
- # babashka (19)
- # beginners (84)
- # calva (3)
- # cider (5)
- # clj-commons (22)
- # clj-kondo (31)
- # cljdoc (4)
- # cljs-dev (5)
- # clojure (65)
- # clojure-australia (1)
- # clojure-europe (44)
- # clojure-nl (2)
- # clojure-uk (2)
- # clojurescript (18)
- # code-reviews (12)
- # conjure (2)
- # core-async (12)
- # data-science (1)
- # datomic (47)
- # deps-new (1)
- # emacs (2)
- # events (4)
- # fulcro (35)
- # integrant (1)
- # jobs (5)
- # jobs-discuss (10)
- # london-clojurians (1)
- # lsp (13)
- # music (1)
- # nextjournal (1)
- # off-topic (11)
- # parinfer (3)
- # pathom (6)
- # polylith (11)
- # portal (41)
- # re-frame (4)
- # reagent (13)
- # reitit (8)
- # remote-jobs (3)
- # sci (18)
- # shadow-cljs (34)
- # spacemacs (3)
- # tools-build (12)
- # tools-deps (6)
- # vim (2)
- # xtdb (7)
I'm trying to get https://github.com/fulcrologic/fulcro-rad-demo running and am having trouble getting the cljs repl working in emacs. I bumped the cljs version to 1.10.879
to match what I think shadow-cljs 2.15.12
wants but I'm still getting user-error: The shadow-cljs ClojureScript REPL is not available
. When I look at *nrepl-messages*
I see this:
(-->
id "8"
op "eval"
session "844724f8-aa75-4953-bd4e-6ed230a647bf"
time-stamp "2021-11-08 20:48:50.415368000"
code "(require 'shadow.cljs.devtools.api)"
)
...
(<--
id "8"
session "844724f8-aa75-4953-bd4e-6ed230a647bf"
time-stamp "2021-11-08 20:48:51.723743000"
err "Execution error (NoClassDefFoundError) at jdk.internal.reflect.NativeMethodAccessorImpl/invoke0 (NativeMethodAccessorImpl.java:-2).
Could not initialize class com.google.javascript.jscomp.DiagnosticGroups
"
)
...
Does that error mean anything to anyone? Any idea where to look next?@bmaddy 2.15.13 or 2.26.0 want that cljs version. see https://clojars.org/thheller/shadow-cljs
I don't use emacs though so I can't say anything other than what their docs already say
if that require does anything though I guess you are not connected to the shadow-cljs nrepl? otherwise it should be loaded already
I was able to get yarn shadow-cljs cljs-repl :main
to evaluate code once I had yarn shadow-cljs watch :main
running somewhere else and my browser loaded. That sounds to me like the problem is firmly on the #cider side of things. Thanks for the thoughts here and for the excellent REPL troubleshooting documentation--that cleared some stuff up for me.
I think I’m experiencing this issue: https://github.com/thheller/shadow-cljs/issues/948. In development everything works fine, since I have the compiler option :output-feature-set :es8
active. But in release mode, I get the error described in the issue. I’m assuming I shouldn’t use that compiler option in release mode. Does anyone have a solution/work-around?
Not sure if this is the best solution, but we’re now using this in release mode:
:release {:compiler-options {:output-feature-set :es5}}
This fixes the issue for us.this should absolutely not be required. can you try if this is maybe related to incremental compiles?
if you get the error on shadow-cljs release
just wipe the .shadow-cljs/builds/<your-build-id>/release
dir and try again
I just fixed the other issue but your problem description seems different so I'm not sure they are actually related
Thanks for your feedback @U05224H0W. Wiping out the .shadow-cljs
folder unfortunately doesn’t fix it. And I do think it’s the same issue, because it’s also for me the Col
element in react-bootstrap
(now version 2.0.0, no longer rc). I just now updated shadow-cljs
to 1.16.2. The steps that I’m doing:
• rm -rf .shadow-cljs node_modules
• npm i
• npx shadow-cljs -A:my-client server
• npx shadow-cljs -A:my-client release :my-client
I then request my HTML page through the dev server and I get TypeError: $jscomp.makeIterator is not a function
in the JS console. Leaving out the Col
element makes the error disappear. I can try to make a small reproduction project if that helps.
so as far as I can tell the problem seems to be that the closure compiler rewrites some code expecting some polyfills (eg. $jscomp.makeIterator
) to be available. normally when it does such replacements it also ensures that the polyfills will be injected itself. somehow something in the Col
file however only causes the rewrite without ensuring its actually present
the fix I made seemed to work around the problem somewhat reliably but I guess not for your case
so a repro might help track it down further although I made a minimal case that ONLY included Col
and that worked just fine
but I have to ask since it is such a common mistake: when you updated shadow-cljs did you actually update it in deps.edn
or only package.json
?
Maybe your reproduction scenario was too minimal then? 😛 I’ll try to setup something up later this morning!
@U05224H0W I have created a small repo that reproduces the issue for me. I think for the error to occur, the Col
must be inside a Row
and/or Container
; just the Col
may not trigger that code path.
https://github.com/svdo/shadow-cljs-948
Really? 🤯 I’ll have a coworker try as well and get back. Very strange. You did the steps exactly like I described in the README right?
it should work in 2.16.4
if you add :js-options {:force-library-injection #{"es6/util/makeiterator"}}
to your build config
@U05224H0W Your skills never cease to amaze me, this is great Thomas!!!
Morning all! Enjoying shadow-cljs here! Unfortunately my search-fu it failing me and I can't find out if there's a way to make it automatically open a web page when compilation first completes. I'm sure that used to be a thing.
@peterwestmacott that was never an option. figwheel does this but shadow-cljs does not
Ah, okay. Thanks for letting me know.
Awesome tool btw, love it!
Would you consider it a desirable feature? Or is it definitely out of scope?