This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-10
Channels
- # announcements (4)
- # babashka (29)
- # beginners (15)
- # calva (4)
- # cljs-dev (1)
- # clojure (28)
- # clojure-dev (13)
- # clojure-europe (3)
- # clojure-india (1)
- # clojure-spec (7)
- # clojure-uk (5)
- # clojurescript (37)
- # component (2)
- # conjure (60)
- # cursive (2)
- # datomic (1)
- # emacs (1)
- # figwheel-main (18)
- # fulcro (38)
- # graalvm (6)
- # graphql (13)
- # helix (14)
- # jobs-discuss (1)
- # joker (5)
- # lein-figwheel (2)
- # nrepl (3)
- # off-topic (15)
- # other-languages (1)
- # other-lisps (1)
- # pedestal (2)
- # reagent (8)
- # reitit (44)
- # shadow-cljs (83)
- # slack-help (8)
- # spacemacs (1)
Hey, I'm trying to move from React to Reagent using `shadow-cljs` but for some reason I don't understand, I keep getting this message *shadow-cljs - Stale Client! You are not using the latest compilation output!*
When I add break points on any piece of code it seems like it gets to it but does not really execute it. not even `(js/alert "lala")`
@mss that is a version conflict. you have the incorrect clojurescript version. 2.9.0
needs cljs 1.10.758
,
@eliraz.kedmi157 that means that the code you are loading is not the code produced by the watch
you have running. commonly that happens if you configure a different :output-dir
or :modules
without updating the references in your HTML to actually use those files.
FWIW I pushed 2.9.0 yesterday which was bumped to 2.9 because of the classpath indexing changes. this should make startup a little faster and have less issues with bad jar contents (containing compiled CLJS output). I hope it doesn't have any other negative effects, so if something weird starts to happen in your apps let me know.
@yenda in 2.9.0
you can also turn of source maps for react native via :compiler-options {:source-map false}
@eliraz.kedmi157 I always get stale client error when forgot to turn of caching in chrome dev tools.
Hello! I am trying to add Quil to my project but when I try to compile it tells me that The required JS dependency "p5" is not available, it was required by "cljsjs/p5.cljs".
I close the repl, npm install p5
, it tells me that it adds + [email protected]
and I can see the folder in /node_modules/
, but when I lein dev
it fires back up and eventually tells me that it is still missing p5. What else should I be doing to fix this?
@dpsutton no it isn't. that is already the stub file mapping the cljsjs package to p5
@skiracer1292 I don't know what lein dev
does so I can't help much. make sure you are in the correct directory and so on. also make sure lein dev
isn't resetting your node_modules
or so
I am still pretty new to clojure and was recommended the re-frame template to start but if you don't recommend using the lein-shadow
plugin that comes packaged with it I will look into setting the project back up to just use shadow and see if I can avoid this all together.
@skiracer1292 just make sure you are actually in the correct directories ... lein-shadow
sort of starts out without a package.json
and if you run npm install p5
in a directory without a package.json then all bets are off where it actually installs things
I am in the project base directory when I install and can see the folder created in ~/project/node_modules/
, if I have a finder window watching the node_modules I see the p5 folder get culled out.
I tried adding "p5": "1.0.0"
to the existing package.json and also watch that get replaced when I lein dev
, which is defined as ["with-profile" "dev" "do" ["shadow" "watch" "app"]]
in alases and {:dependencies [[binaryage/devtools "1.0.0"]] :source-paths ["dev"]}
in profiles
dunno why it does that. its not shadow-cljs doing that. I tried to convince the authors not to use lein-shadow but somehow this is supposed to be easier with it ...
Could you please provide some concrete information behind this @thheller. Why ? What is the disadvantage ?
In an attempt to stop support issues hitting this channel, we have added to the docs: https://github.com/day8/re-frame-template#how-to-add-dependencies
that is precisely why. npm should be in charge of it and npm should be used as is. consider that there might be people coming from the JS ecosystem familiar with npm (or yarn) and then suddenly things don't work as expected
people might just want to use npm as is ... maybe they want scripts, maybe they want other things in package.json
also I always point people towards my docs and even the error message tells people to run npm install whatever
I completely disagree with doing everything in project.clj ... that counts for shadow-cljs.edn as well since you lose a bunch of features by doing that
one thing npm does better than anything in CLJ(S) is npm install some-package
without having to know the version
IMHO you are not fixing anything npm related by moving it and just make it look like it doesn't exist.
Thanks for the feedback @thheller, but its still not clear why the recommendation you propose is better for common use cases for ClojureScript devs
Ok will await that 🙂 Thanks.
FWIW I looked at the source and it seems like you are supposed to add :npm-deps {"p5" "1.0.0"}
to your project.clj
> It also manages your npm dependencies in the :npm-deps key, checking for any changes on every run.
where are you seeing these docs? I have looked around for lein-shadow docs and found nothing 😞
I just found https://gitlab.com/nikperic/lein-shadow/-/blob/master/examples/lein-shadow-example/project.clj and tried to mimic their :npm-deps
key with :npm-deps [[p5 "1.0.0"]]
and it still culls out my p5 library. same with :npm-deps {"p5" "1.0.0"
@thheller ever come across this issue?
errors in file: /Users/njam/Github/nsauce/cannabit-lp/node_modules/request-compose/compose.js
{:js-str-offsets [], :js-esm false, :js-imports [], :js-invalid-requires [], :goog-provides [], :js-language "es8", :goog-module nil, :js-warnings [], :resource-name "node_modules/request-compose/compose.js", :js-requires [], :js-errors [{:line 140, :column 3, :message "primary expression expected"}], :goog-requires [], :tag :shadow.build.npm/errors, :uses-global-buffer false, :uses-global-process false}
ExceptionInfo: errors in file: /Users/njam/Github/nsauce/cannabit-lp/node_modules/request-compose/compose.js
yeah quick glance at the code it is pretty clear this isn't intended to run in the browser