Fork me on GitHub
#shadow-cljs
<
2020-07-15
>
Rabie17:07:53

Hi, I've been googling for a while without finding an answer. I'm using shadow-cljs with calva and I use the jack-in REPL to connect to localhost:8280. For a strange reason I keep having the messae Stale Client! You are not using the latest compilation output Is there a quick way of cleaning up everythin so shadow-cljs can recomplile everything from scratch? Thank you?

thheller17:07:06

@rnait1977 there is not much to clean up. make sure you are loading the correct compilation output. maybe you changed your :output-dir and didn't adjust the paths you used to include the .js files?

thheller17:07:35

shadow-cljs does recompile everything from scratch but it can't do anything if you are not loading the files it created.

thheller17:07:22

maybe you change a :modules {:foo ..} name but don't load the new foo.js file?

Rabie17:07:58

No actually I just created a new file undo-interceptor.cljs

Rabie17:07:09

May be it's clava/vs code related

thheller17:07:47

no it isn't. it really is that simple. check if you are loading the correct file from your HTML. it is nothing else.

thheller17:07:03

well it might be cache if you are not using the default shadow-cljs dev-http server?

thheller17:07:33

you might have 2 shadow-cljs instances running for the same project?

pez17:07:25

I think it is the browser caching the old client. Refresh w/o caches usually clears things up for me.

thheller17:07:31

the :dev-http servers handle caching correctly so that doesn't happen but any other server may not do that

Rabie17:07:36

You were right Thomas. It's not realted to Calva nor shadow-cljs. Actually I made a mistake in naming the namespace which provoked a build error and the error message doesn't show up clearly in vs code. Thanks for your help guys 🙂

👍 3
pez18:07:50

Then it is a bit related to Calva in that the error could be better surfaced.

Drew Verlee21:07:31

I run cider-jack-in with configuration to choose shadow cljs and i successfully launch a browser. Which then immediately tells me my state is stale. in the browser client i see websocket connected! websocket disconnected! I would expect either the state to not be state (which i assume means the shadow server isn't able to read the compiled js and reload) or i would expect an error.

Drew Verlee21:07:50

now if i refresh on the 3rd time the stale error goes away. But cider isn't connected to the repl.

Drew Verlee21:07:48

if i run shadow-cljs watch app where app is the name of my app (original i know) then i get an exception aboud piggieback which i can't fathom.

➜  Cabotage git:(labtest-results-should-get-its-own-page) ✗ yarn watch
yarn run v1.22.4
$ shadow-cljs watch app;
shadow-cljs - config: /home/drewv/work/breezeehr/master-at-arms/Cabotage/shadow-cljs.edn
shadow-cljs - starting via "clojure"
Downloading: binaryage/devtools/1.0.2/devtools-1.0.2.pom from 
Downloading: binaryage/devtools/1.0.2/devtools-1.0.2.jar from 
[2020-07-15 16:22:48.972 - WARNING] :shadow.cljs.devtools.server/nrepl-ex
Note: The following stack trace applies to the reader or compiler, your code was not executed.
CompilerException Unexpected error macroexpanding if-ns at (cider/piggieback.clj:22:1). #:clojure.error{:phase :macroexpansion, :line 22, :column 1, :source "cider/piggieback.clj", :symbol if-ns}
	clojure.lang.Compiler.macroexpand1 (Compiler.java:7019)
	clojure.lang.Compiler.macroexpand (Compiler.java:7075)
	clojure.lang.Compiler.eval (Compiler.java:7161)
	clojure.lang.Compiler.load (Compiler.java:7636)
	clojure.lang.RT.loadResourceScript (RT.java:381)
	clojure.lang.RT.loadResourceScript (RT.java:372)
	clojure.lang.RT.load (RT.java:459)
	clojure.lang.RT.load (RT.java:424)
	clojure.core/load/fn--6839 (core.clj:6126)
	clojure.core/load (core.clj:6125)
	clojure.core/load (core.clj:6109)
	clojure.core/load-one (core.clj:5908)
Caused by:
NoSuchFieldError ES3
	cljs.closure__init.load (:133)
	cljs.closure__init.<clinit> (:-1)
	java.lang.Class.forName0 (Class.java:-2)
	java.lang.Class.forName (Class.java:348)
	clojure.lang.RT.classForName (RT.java:2211)
	clojure.lang.RT.classForName (RT.java:2220)
	clojure.lang.RT.loadClassForName (RT.java:2239)
	clojure.lang.RT.load (RT.java:449)
	clojure.lang.RT.load (RT.java:424)
	clojure.core/load/fn--6839 (core.clj:6126)
	clojure.core/load (core.clj:6125)
	clojure.core/load (core.clj:6109)
shadow-cljs - HTTP server available at 
shadow-cljs - server version: 2.10.14 running at 
shadow-cljs - watching build :app
[:app] Configuring build.
[:app] Compiling ...
[2020-07-15 16:23:17.405 - WARNING] :shadow.cljs.devtools.server.util/handle-ex - {:msg {:type :start-autobuild}}
NoClassDefFoundError Could not initialize class cljs.repl__init
	java.lang.Class.forName0 (Class.java:-2)
	java.lang.Class.forName (Class.java:348)
	clojure.lang.RT.classForName (RT.java:2211)
	clojure.lang.RT.classForName (RT.java:2220)
	clojure.lang.RT.loadClassForName (RT.java:2239)
	clojure.lang.RT.load (RT.java:449)
	clojure.lang.RT.load (RT.java:424)
	clojure.core/load/fn--6839 (core.clj:6126)
	clojure.core/load (core.clj:6125)
	clojure.core/load (core.clj:6109)
	clojure.core/load-one (core.clj:5908)
	clojure.core/load-one (core.clj:5903)

Drew Verlee21:07:32

this happens after i bumped shadow cljs it seems. i can post the specific update if there is interest.

dpsutton22:07:33

i'd recommend doing everything in the command line until you are sure everything works

dpsutton22:07:49

only use CIDER on a known working project. then if there's an issue its definitely in CIDER

Drew Verlee22:07:14

i suspect it's an issue in cider. i can't properly run cider-jack-in and connect to my the nrepl server that shadow sets up. I guess ill rollback.

Drew Verlee22:07:07

This seems to appear even though i have no dependencies configured. What could that mean?

=============================================================================
WARNING: The configured :dependencies in shadow-cljs.edn were ignored!
         When using :deps they must be configured in deps.edn
==============================================================================

thheller08:07:53

the check is literally (seq (:dependencies config)) so you definitely have something in :dependencies configured?

Drew Verlee13:07:02

I do. it's in my root shadow-cljs config ./shadow-cljs/config.edn

thheller16:07:56

ah right

👍 3