Fork me on GitHub
#shadow-cljs
<
2021-04-16
>
happyb3at10:04:35

How to debug this error? I create a brand new project but get IllegalArgumentException: no conversion to symbol Clojure lein new re-frame duck Retrieving re-frame/lein-template/2.1.2/lein-template-2.1.2.pom from clojars Retrieving re-frame/lein-template/2.1.2/lein-template-2.1.2.jar from clojars Generating re-frame project. ➜ Clojure cd duck  ➜ duck shadow-cljs run shadow-cljs - config: /home/hovgaard/Clojure/duck/shadow-cljs.edn shadow-cljs - updating dependencies Retrieving thheller/shadow-cljs/2.12.5/shadow-cljs-2.12.5-aot.jar from https://repo.clojars.org/ shadow-cljs - dependencies updated running: npm install --save --save-exact [email protected] [email protected] added 101 packages, and audited 102 packages in 2s 3 packages are looking for funding  run npm fund for details found 0 vulnerabilities IllegalArgumentException: no conversion to symbol        clojure.core/symbol (core.clj:596)        clojure.core/symbol (core.clj:589)        shadow.cljs.devtools.cli-actual/do-clj-run (cli_actual.clj:70)        shadow.cljs.devtools.cli-actual/do-clj-run (cli_actual.clj:65)        shadow.cljs.devtools.cli-actual/blocking-action (cli_actual.clj:126)        shadow.cljs.devtools.cli-actual/blocking-action (cli_actual.clj:116)        shadow.cljs.devtools.cli-actual/main (cli_actual.clj:177)        shadow.cljs.devtools.cli-actual/main (cli_actual.clj:132)        clojure.core/apply (core.clj:669)        clojure.core/apply (core.clj:660)        shadow.cljs.devtools.cli-actual/-main (cli_actual.clj:219)        shadow.cljs.devtools.cli-actual/-main (cli_actual.clj:217)        clojure.lang.Var.applyTo (Var.java:705)        clojure.core/apply (core.clj:665)        clojure.core/apply (core.clj:660)        shadow.cljs.devtools.cli/-main (cli.clj:75)        shadow.cljs.devtools.cli/-main (cli.clj:67)        clojure.lang.Var.applyTo (Var.java:705)        clojure.core/apply (core.clj:665)        clojure.main/main-opt (main.clj:514)        clojure.main/main-opt (main.clj:510)        clojure.main/main (main.clj:664)        clojure.main/main (main.clj:616)        clojure.lang.Var.applyTo (Var.java:705)        clojure.main.main (main.java:40) duck clojure --version Clojure CLI version 1.10.3.822 duck java --version openjdk 11.0.10 2021-01-19 OpenJDK Runtime Environment 18.9 (build 11.0.10+9) OpenJDK 64-Bit Server VM 18.9 (build 11.0.10+9, mixed mode, sharing)

thheller11:04:57

@alan.hovgaard why do you call shadow-cljs run? that expects more arguments? did you mean shadow-cljs server, shadow-cljs watch app or so?

happyb3at18:04:06

Wow yeah.. shadow-cljs watch app ...all works fine... RTFM... thx thheller 🙂

Schpaa15:04:33

Getting this when trying to include some modules of codemirror

Closure compilation failed with 1 errors
--- node_modules/lezer-tree/dist/tree.cjs:385
ES6 transpilation of 'declaration with multiple destructuring children not in statement block' is not yet implemented.

mkvlr16:04:17

go lezer!

Schpaa15:04:48

is there a trick I could do to avoid this?

thheller15:04:02

set :compiler-options {:output-feature-set :es6}

Schpaa15:04:08

nice, that works, and thanks!

yedi18:04:34

hey folks, i'm using shadow-cljs to create a Github Action that uses cljs (targeting nodejs). I'm getting what looks like extern related errors when the built JS is run by Github. I do see some inference warnings in the shadow-cljs build output here's the error I see when the github action is run: "f.git.zc is not a function" here's the code that's failing (println (<p! (.. octokit -git (updateRef update-args)))) - octokit is pulled from a github npm library. so this def seems externs related but I'm wondering how i'd resolve this in a nodejs context? do I really need to add externs for each function i want to use from github's library? interestingly, i have another line prior to the above which seems to run successfully without any extern issues: ref-resp (js->clj (<p! (.. octokit -git (getRef ref-args)))) any idea what might be happening here?

thheller18:04:36

the problem is that core.async loses typehints so even if you type hint the externs inference doesn't work correctly

thheller18:04:44

but yeah this is an externs issue

thheller18:04:13

you can fix it by moving as much interop code out of the go block as possible

yedi18:04:56

so if i wrap those lines in a function defined outside of the go block, i should be good?

thheller18:04:15

depends on what octokit is but in theory yes

yedi18:04:21

i'll try it and see what happens

yedi18:04:49

so that looks like it's workign thanks @thheller

yedi18:04:15

just out of curiosity do you recommend folks use a lib like cljs-oops in order to not worry about externs?

thheller18:04:47

I wouldn't recommend using it

thheller18:04:07

normally externs inference is a much better way to go, it just suffers a little in core.async

👍 3
yedi18:04:39

ok i actually had one last question (though this might be more on the github actions end) - if i don't commit the node_modules/ directory along with the JS script that shadow-cljs outputs, then I get this error when the script is run on github: Error: Cannot find module '@actions/core' while committing node_modules/ alongside the script seems to work, i always thought doing a release with shadow-cljs would automatically use the closure compiler to inject the relevant JS from those node modules into the outputted script. i feel like there might be a piece of this i'm not following

thheller18:04:50

by default :node-script (which I assume you are using?) does not bundle the dependencies since node will provide them via node_modules

thheller18:04:13

you can post-process the file with https://github.com/vercel/ncc which would make it standalone

yedi18:04:12

ah k, i saw that recommended elsewhere, was wondering if its still the same with shadow. cool ty