This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-09-22
Channels
- # announcements (2)
- # beginners (137)
- # chlorine-clover (13)
- # clj-kondo (3)
- # cljsrn (4)
- # clojure (52)
- # clojure-australia (3)
- # clojure-dev (2)
- # clojure-europe (34)
- # clojure-nl (1)
- # clojure-sg (3)
- # clojure-spec (1)
- # clojure-uk (12)
- # clojurescript (2)
- # clojureverse-ops (7)
- # code-reviews (3)
- # conjure (2)
- # cursive (18)
- # datavis (21)
- # datomic (34)
- # exercism (1)
- # figwheel-main (6)
- # graphql (3)
- # helix (21)
- # introduce-yourself (1)
- # jackdaw (1)
- # jobs (4)
- # jobs-discuss (32)
- # juxt (14)
- # leiningen (6)
- # lsp (35)
- # meander (19)
- # nrepl (2)
- # off-topic (37)
- # portal (40)
- # quil (5)
- # re-frame (45)
- # reagent (10)
- # releases (1)
- # remote-jobs (4)
- # reveal (15)
- # sci (7)
- # shadow-cljs (40)
- # spacemacs (3)
- # tools-build (2)
- # vim (17)
- # xtdb (11)
I think I figured out what the problem was, seems that it was a monorepo on the top level and the package I had to link to was under a packages directory
Hi, when releasing an app using eternal-index
js-options, I had this warning:
[:app] Compiling ...
------ WARNING #1 - -----------------------------------------------------------
Resource: shadow.js.shim.module$react_dom.js:3:34
variable shadow$bridge is undeclared
Any clue?
hmm did I not add that to the externs? could have sworn I did. which version do you use?
Version 2.15.10
OK, I wiil. Thanks
Has anyone gotten build reports to work recently? I'm trying but it's failing with:
failed to run function: shadow.cljs.build-report/-main
{:tag :shadow.cljs.devtools.cli-actual/clj-run, :main-sym shadow.cljs.build-report/-main}
ExceptionInfo: failed to run function: shadow.cljs.build-report/-main
shadow.cljs.devtools.cli-actual/do-clj-run (cli_actual.clj:110)
...
Caused by:
Hook [0 shadow.cljs.build-report/hook] failed in stage :flush
NoSuchFileException: .shadow-cljs/release-snapshots/my-build/latest/main.js
I am not sure where main.js is coming from...Okay, I figure it out. Build reports assumes the output file is named after the thing in :modules
but if you use :output-to
then it gets named something completely different.
shadow-cljs can't find the output.
Thanks, I somehow got it to work by changing output to "main.js". I was using this for AWS Lambda and trying to figure out cold boot time, where size does have a impact.
Could this be because I am trying to make a :node-library
and it is missing :modules {:main {}}
?
Hi,
I'm trying to run shadow-cljs watch app
. I'm using WSL on windows via VS Code.
This project I'm trying to run works perfectly on my Ubuntu machine. But when I try to run watch app
on WSL I'm getting the following error:
stuarts@x-lap-562:/mnt/c/Users/stuarts/Source/___TESTREPOS/__Clojure/tic-tac-toe-re-frame$ shadow-cljs watch app
shadow-cljs - config: /mnt/c/Users/stuarts/Source/___TESTREPOS/__Clojure/tic-tac-toe-re-frame/shadow-cljs.edn
Execution error (NoClassDefFoundError) at java.lang.Class/forName0 (Class.java:-2).
Could not initialize class cognitect.transit__init
Full report at:
/tmp/clojure-11163815081130707132.edn
Any ideas what I'm doing wrong.
My shadow-cljs.edn
;; shadow-cljs configuration
{:source-paths
["src/dev"
"src/main"
"src/test"]
:dependencies
[[binaryage/devtools "0.9.10"]
[reagent "1.0.0"]
[re-frame "1.2.0"]
[day8.re-frame/re-frame-10x "1.0.1"]
[day8.re-frame/http-fx "0.2.3"]
[bidi "2.1.6"]
[cljs-ajax "0.8.1"]
[com.andrewmcveigh/cljs-time "0.5.2"]
[com.rpl/specter "1.1.3"]]
:nrepl {:port 3333}
:dev-http {8080 "public"}
:builds {:app {:target :browser
:output-dir "public/js"
:modules {:main {:init-fn }}
:compiler-options {:closure-defines {re-frame.trace/trace-enabled? true
day8.re-frame.tracing/trace-enabled? true}}
:devtools {:http-root "public"
:http-port 3000
:preloads [day8.re-frame-10x.preload]}}}}
Ive installed node on wsl, it reports its version as
stuarts@x-lap-562:/mnt/c/Users/stuarts/Source/___TESTREPOS/__Clojure/tic-tac-toe-re-frame$ node --version
v16.9.1
Could it as simple as missing the transit dependency?
[com.cognitect/transit-cljs "0.8.269"]
[com.cognitect/transit-clj "1.0.324"]
What happens if you add the above two lines to :dependencies
?
Added those, saved the file, ran shadow-cljs watch app again and got same error
stuarts@x-lap-562:/mnt/c/Users/stuarts/Source/___TESTREPOS/__Clojure/tic-tac-toe-re-frame$ shadow-cljs watch app
shadow-cljs - config: /mnt/c/Users/stuarts/Source/___TESTREPOS/__Clojure/tic-tac-toe-re-frame/shadow-cljs.edn
WARNING: The com.cognitect/transit-clj dependency in shadow-cljs.edn was ignored. Default version is used and override is not allowed to ensure compatibility.
The versions provided by shadow-cljs can be found here:
shadow-cljs - updating dependencies
shadow-cljs - dependencies updated
Execution error (NoClassDefFoundError) at java.lang.Class/forName0 (Class.java:-2).
Could not initialize class cognitect.transit__init
Full report at:
/tmp/clojure-10097363797069404351.edn
Hmm. I don't have any immediately ideas.
• Maybe there is some global deps.edn modifying version.
• Try npm install shadow-cljs
and ./node_modules/bin/shadow-cljs
to use latest version
• Does moving the project into the Linux FS instead of /mnt/c
work?
Does shadow-cljs classpath
show anything wrong?
The next I would try is to upgrade shadow-cljs. According to the log, you are using version 2.11.22, which seems a bit old compared to current being https://clojars.org/thheller/shadow-cljs/versions/2.15.10
Like personally I do what said above and use the one from npm install and node_modules to ensure that the tool is version controlled and always up to date when I use npm-check-upgrades
I would uninstall the global one.
do you mean install it like in here: https://shadow-cljs.github.io/docs/UsersGuide.html#_standalone_via_code_npm_code ?
Something like that yeah.
1. Create a package.json if you don't already have it npm init
and put in whatever.
2. npm install --save-dev shadow-cljs
3. ./node_modules/.bin/shadow-cljs watch app
:clojure.error/class java.lang.NoClassDefFoundError,
:clojure.error/line -2,
:clojure.error/cause "Could not initialize class cognitect.transit__init",