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 react@17.0.1 react-dom@17.0.1
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)
@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?
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.
is there a trick I could do to avoid this?
set :compiler-options {:output-feature-set :es6}
nice, that works, and thanks!
go lezer!
Wow yeah.. shadow-cljs watch app ...all works fine... RTFM... thx thheller 🙂
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?
the problem is that core.async loses typehints so even if you type hint the externs inference doesn't work correctly
but yeah this is an externs issue
you can fix it by moving as much interop code out of the go block as possible
so if i wrap those lines in a function defined outside of the go block, i should be good?
depends on what octokit
is but in theory yes
i'll try it and see what happens
so that looks like it's workign thanks @thheller
just out of curiosity do you recommend folks use a lib like cljs-oops in order to not worry about externs?
I wouldn't recommend using it
normally externs inference is a much better way to go, it just suffers a little in core.async
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
by default :node-script
(which I assume you are using?) does not bundle the dependencies since node will provide them via node_modules
you can post-process the file with https://github.com/vercel/ncc which would make it standalone
ah k, i saw that recommended elsewhere, was wondering if its still the same with shadow. cool ty