This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-04-10
Channels
- # announcements (4)
- # beginners (116)
- # boot (4)
- # calva (63)
- # cider (8)
- # clara (20)
- # cljdoc (10)
- # cljsrn (69)
- # clojure (115)
- # clojure-austin (1)
- # clojure-dev (4)
- # clojure-finland (1)
- # clojure-italy (3)
- # clojure-nl (6)
- # clojure-russia (10)
- # clojure-uk (84)
- # clojurescript (28)
- # cursive (14)
- # data-science (1)
- # datascript (1)
- # datomic (11)
- # duct (3)
- # emacs (13)
- # figwheel-main (11)
- # fulcro (4)
- # graphql (6)
- # jackdaw (2)
- # jobs (23)
- # jobs-rus (1)
- # kaocha (11)
- # lein-figwheel (13)
- # leiningen (55)
- # luminus (14)
- # lumo (22)
- # off-topic (121)
- # pathom (19)
- # re-frame (6)
- # reagent (3)
- # reitit (22)
- # remote-jobs (10)
- # ring-swagger (1)
- # shadow-cljs (67)
- # slack-help (5)
- # spacemacs (1)
- # sql (18)
- # vim (28)
- # yada (2)
@d4hines you could also use (gobj/set (.getElementById js/document "fps") "innerHtml" (str "<p>" n "<p>"))
gobj
=> goog.object
Thanks!
@lilactown @wilkerlucio can you confirm that .shadow-cljs
is a git ignored directory in your projects? just a guess but maybe git messes with the .shadow-cljs
dir when switching branches? probably not but who knows š
@thheller yup, its confirmed, and in my case I wasn't switching branches, just the shadow-cljs version
hello @thheller, Iām sorry to bother you again but my js file importing adventure is not finished yet
now it seems that everything works if I call functions from the js file that do not depends on imported modules
but when I use a more complex function with external dependencies the compiler complains like in this case:
node target/main.js SHADOW import error /Users/arusso/Development/clojurescript/ask-scopus/.shadow-cljs/builds/app/dev/out/cljs-runtime/server.google_sheet.js /Users/arusso/Development/clojurescript/ask-scopus/.shadow-cljs/builds/app/dev/out/cljs-runtime/server/oauth2.js:17 fs.readFile(ācredentials.jsonā, (err, content) => { ^ TypeError: fs.readFile is not a function at Object.readFile [as auth_init] (/Users/arusso/Development/clojurescript/ask-scopus/.shadow-cljs/builds/app/dev/out/cljs-runtime/server/oauth2.js:17:5) at /Users/arusso/Development/clojurescript/ask-scopus/.shadow-cljs/builds/app/dev/out/cljs-runtime/server/google_sheet.cljs:8:1 at global.SHADOW_IMPORT (/Users/arusso/Development/clojurescript/ask-scopus/target/main.js:64:44) at /Users/arusso/Development/clojurescript/ask-scopus/target/main.js:2195:1 at Object.<anonymous> (/Users/arusso/Development/clojurescript/ask-scopus/target/main.js:2199:3) at Module._compile (internal/modules/cjs/loader.js:805:30)
and the [ā./oauth2ā :as auth] in the clojurescript namespace. In fact an dependency-free hello-world function from the js file is correctly imported and called from the CLJS namespace.
@thheller can you point me to some docs to convert my js file to ESM and import it correctly in CLJS? Sorry Iām pretty ignorant in JavaScript modules land
hello, I am struggling with shadow-cljs and hope you could help me (or point me somewhere), is there any way to run browsers tests (or karma test) in watch mode? (to be more explicit, re-run affected tests only whenever something changes in the code/tests)
well, actually yes. I am really sorry for the stupid question but your answer really helped me, thanks š
random question: does shadow-cljs send the form that was evaluated to the browser when you evaluate at the REPL?
> source is included, not the form What does that mean? Arenāt they equivalent?
Oh, gotcha. So source = string, form = data.
I'm converting a figwheel-based project to shadow-cljs and finding that compilation w/ shadow-cljs fails on reagent's with-let
macro, complaining that the vars referenced in the output of that macro are undeclared. Any possible causes come to mind?
with-let has been in reagent for several releases now - it seems to me that the macro is evaluating just fine but the code it's outputting includes references to vars shadow-cljs doesn't know about for whatever reason. I'm also seeing warnings about "provide conflicts" due to re-frame and some others putting compiled assets in their jars - think it's possible that's related?
Pretty sure it's the same situation you talked about here: https://github.com/thheller/shadow-cljs/issues/473, ignoring the stuff about that person's macros + ns problems.
Actually, some of the complaints are about goog libs, so maybe I have something else going on. For example: [2019-04-10 14:30:26.531 - WARNING] provide conflict for #{goog.labs.userAgent.engine} provided by goog/labs/useragent/engine.js and {"/out/goog/labs/useragent/engine.js" #{goog.labs.userAgent.engine}}
I do not have an out
, just target
, which I've been rm -rf
ing after the failed builds to make a clean slate. There are other possible complications w/ my build setup. I'm using lein for my deps + source-paths because some of my deps are stored in a private s3 bucket. My shadow-cljs config file is pretty simple though:
{:lein {:profile "+dev-client"}
:builds {:app {:output-dir "target/admin/client/public/js/compiled/"
:asset-path "/"
:target :browser
:modules {:main {:entries [kc.admin.user]}}
}}}
> [2019-04-10 14:30:26.531 - WARNING] provide conflict for #{goog.labs.userAgent.engine} provided by goog/labs/useragent/engine.js and {"/out/goog/labs/useragent/engine.js" #{goog.labs.userAgent.engine}}
this means there was an "unexpected" source file in /out/goog/labs/useragent/engine.js
on the classpath, which can be in a jar. doesn't need to be one of YOUR paths
Ok, I will look for something on the classpath containing the offending files. Thanks for the help.
Yeah, that did it, thanks. Turns out the culprit was that same re-frame-utils lib from that issue. I didn't even realize it was in my project.clj. š
I see the manual has a "what to do when things don't work" section that basically just says "ask on slack". Would you be interested in a PR describing this issue and its resolution in that section?