Fork me on GitHub
#shadow-cljs
<
2022-07-01
>
Andrew07:07:27

Hey all. I was wondering if it is possible to use https://github.com/bensu/doo together with shadow-cljs? I'm getting errors running lein doo about React components from node_modules being not found, so I'm suspecting it's not

thheller07:07:54

no, its a leiningen plugin that directly uses the cljs compiler

Andrew07:07:35

Okay, thanks!

Andrew07:07:36

Is there some kind of lein plugin that'll make the whole testing thing - build the JS and run it with pre-configured runner? So that one does not have to run bunch of npx commands (well, actually 2, but still šŸ˜… )

thheller07:07:09

well there is :target :karma that a few people use

Andrew07:07:15

I'm using karma as well, but to run tests I've made shell script which does

npx shadow-cljs compile test
npx karma start --single-run
Is there a way to achieve similar outcome from within lein ?..

Andrew07:07:25

Sorry for such noobish questions šŸ˜…

Andrew07:07:23

What I mean is it'd be great to have a single entrypoint (a single command) to kick off the test run

thheller07:07:08

I mean there are gazillion tools to solve that issue? Just a Makefile or npm "scripts" or whatever

thheller07:07:27

or even just lein

thheller07:07:36

or even just npx shadow-cljs compile test && npx karma start --single-run

Andrew08:07:57

Right. I ended up writing bb.edn to solve it with babashka šŸ˜Š Thanks for the pointers!

ā¤ļø 1
Roman Liutikov12:07:10

getting the following error in 2.19.5, is that known?

Syntax error compiling at (shadow/build/data.clj:360:5).
No such var: ana/get-data-readers

āž• 1
eggsyntax14:07:21

Hmm, also on 2.19.4.

eggsyntax14:07:07

Including [org.clojure/tools.analyzer "1.1.0"] on the clojure side of deps (in project.clj) solves it for me.

thheller19:07:08

I'm guessing you are using deps.edn or project.clj? make sure you have the proper matching clojurescript versions?

thheller19:07:23

should be 1.11.60

thheller19:07:08

ana is cljs.analyzer. dujnno why adding tools.analyzer would do anything

eggsyntax21:07:36

Ohhh, huh. Wild.

ilevd13:07:09

I run shadow-cljs watch app --debug and get runtime error in console without lineNumber and filename, is it possible to configure shadow-cljs to see it?

ilevd13:07:30

Added some compiler options, but it doesn't help

:dev        {:closure-defines  {"re_frame.trace.trace_enabled_QMARK_" true}
                             :compiler-options {:source-map   true
                                                :pseudo-names true
                                                :pretty-print true}
                             }

thheller19:07:19

expand the arrow before "Uncaught" not the one before cljs$core$ExceptionInfo

thheller19:07:29

that should have the proper stacktrace?

thheller19:07:00

pseudo-names and --debug only applies to release builds, does nothing for watch

ilevd07:07:38

It seems that there is only reitit router

thheller07:07:07

typically that error suggests that you are either not passing an argument you are supposed to pass

thheller07:07:15

or the wrong type

thheller07:07:32

s.chatAt suggests it expects a string somewhere

thheller07:07:39

but you are maybe passing something else or just nil. looking at the code may suggest what might be wrong

ilevd10:07:03

I found the error in re-frame event handler, but I want to configure error message, if it possible, to easy find such errors

thheller15:07:13

well there is no config for error messages. this is all there is.

Patrick Brown14:07:21

Accidentally posted this in CLJS, but it belongs here. Sorry for the xpost. Howdy! Is there a simple way to do conditional code evaluation based on build id and not target? Iā€™d like to evaluate code differently for different builds that have the same targetā€¦ Something like. (:require #?(:build-1 [my.app.molecules.build-1] :other-build [my.app.molecules.other])) Where both namespaces contain the same vars, but different logic, yet both are for the same target env. Itā€™s not the end of the world if I canā€™t, just curious.

Patrick Brown20:07:57

Oh, I get it! reader-features is open to anything. Cool feature!

wilkerlucio14:07:45

hello, I have a project that is a library, I would like to make sure all the cljs and cljc files compile file, using the :target :browser I have to use the :entries to find the namespaces, but I would like for shadow to find all cljs and cljc files and try to compile all of then, what kind of build setup I can use to make this?

thheller20:07:23

I guess if you only want to compile all and don't actually care about the output :npm-module is best? you can set a :ns-regexp "your.library" or whatever which will end up including all namespaces matching that?

thheller20:07:46

the test targets can also do that

Patrick Brown16:07:09

FIX: Not a shadow issue. This error is caused by running ā€˜amplify pullā€™ using AWS Amplify. Check your includes, make sure youā€™ve pulled and that the pulled file is in the correct location in relation to your require. Iā€™m having issues with my shadow config. Iā€™m using version ā€œ2.19.5ā€ with all the important deps matching clojars as outlined in https://shadow-cljs.github.io/docs/UsersGuide.html#failed-to-load Iā€™m getting this error while running release. [:main] Compiling ... Execution error (AssertionError) at shadow.build.resolve/maybe-babel-rewrite (resolve.clj:205). Assert failed: (map? rc) My instincts tell me it has something to do with webpack. But Iā€™m lost. I remember having the same error once before and the solve being super simple, small, and dumb. But for the life of me I canā€™t remember what it was. Any help is BIG THANKS! CHEERS!

thheller19:07:24

sorry, can't remember ever seeing this before