#### Welcome to test
If you're seeing this message, that means you haven't yet compiled your ClojureScript!
Please run `shadow-cljs watch app` to start the ClojureScript compiler and reload the page.
I’ve tried a lot of things but with no succes. includng running shadow … from the commandline. any ideas?
I tried this according to your link: :npx shadow-cljs watch app
and got this:
shadow-cljs - config: /Users/jonas/Dropbox/prog/web/clojure/luminus/test/shadow-cljs.edn
shadow-cljs - running: lein with-profile +dev run -m shadow.cljs.devtools.cli --npm watch app
Executable 'lein' not found on system path.
well lein is set in bash_profile but I suspekt that shadow-cljs is looking in either project.cls or shadow-cljs.edn but I cannot find anything on that.
But it is strange that clojurescript support is badly supported in luminus. When following the officical dokumentation and “web development with clojure” it all reads that using lein arguments +cljs should be enough.
Not enough details to help troubleshoot. I didn’t run into any of these issues, with the lein script installed via brew or port, or even manually downloaded and installed in /usr/local/bin. macOS or Linux.
lein new luminus appname -- +shadow-cljs +re-frame ... etc
cd appname
npm install
Seems like I have shadow-cljs installed globally via npm install -g shadow-cljs but I also see the shadow-cljs script is located in appname/node_modules/.bin/
That last npm install command is important as it will install all the required cljs/react/shadow deps in the app’s node_modules directory and allow running shadow and allow compiling the cljs app at all.
I’l also note that I used +shadow-cljs in my lein new command, while your previous example a few days ago only had +cljs.
From there, I usually run the repl from emacs or vscode which starts up all the processes for me, but this also works:
npx shadow-cljs watch app
and separately
lein run
OR
lein repl
To start the main clj app as well.
I have lein, npm, clojure, node all installed via macports so they all reside under /opt/local/, but it shouldn’t be sensibly different if installed via homebrew or other means.
I’m on a Mac too. AFAIK +reagent does not guarantee shadow-cljs (unless things changed since I read the book). Either way when I create the new Luminux project there’s definitely a package.json file with those dependencies included in them.
I just tested with +reagent only, and indeed it had shadow.clj as a dep and created a package.json that looks like:
jonas@Jonass-MBP:~/Dropbox/prog/web/clojure/luminus$ lein new luminus test3 +reagent +sqlite
Generating a Luminus project.
jonas@Jonass-MBP:~/Dropbox/prog/web/clojure/luminus$ cd test3/
jonas@Jonass-MBP:~/Dropbox/prog/web/clojure/luminus/test3$ uname -a
Darwin Jonass-MBP 18.7.0 Darwin Kernel Version 18.7.0: Mon Feb 10 21:08:45 PST 2020; root:xnu-4903.278.28~1/RELEASE_X86_64 x86_64
jonas@Jonass-MBP:~/Dropbox/prog/web/clojure/luminus/test3$ cat package.json
{
"devDependencies": {
"shadow-cljs": "^2.16.5"
},
"dependencies":{
"react": "^17.0.2",
"react-dom": "^17.0.2"
}
}
jonas@Jonass-MBP:~/Dropbox/prog/web/clojure/luminus/test3$ npm install
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
added 98 packages, and audited 99 packages in 8s
3 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
jonas@Jonass-MBP:~/Dropbox/prog/web/clojure/luminus/test3$ shadow-cljs watch app
shadow-cljs - config: /Users/jonas/Dropbox/prog/web/clojure/luminus/test3/shadow-cljs.edn
shadow-cljs - running: lein with-profile +dev run -m shadow.cljs.devtools.cli --npm watch app
Executable 'lein' not found on system path.
jonas@Jonass-MBP:~/Dropbox/prog/web/clojure/luminus/test3$ ./node_modules/.bin/shadow-cljs watch app
shadow-cljs - config: /Users/jonas/Dropbox/prog/web/clojure/luminus/test3/shadow-cljs.edn
shadow-cljs - running: lein with-profile +dev run -m shadow.cljs.devtools.cli --npm watch app
Executable 'lein' not found on system path.
so same error.
but running lein directly works:
jonas@Jonass-MBP:~/Dropbox/prog/web/clojure/luminus/test3$ lein with-profile +dev run -m shadow.cljs.devtools.cli --npm watch app
2022-04-25 19:45:52,669 [main] DEBUG org.jboss.logging - Logging Provider: org.jboss.logging.Slf4jLoggerProvider
2022-04-25 19:46:23,687 [main] INFO io.undertow - starting server: Undertow - 2.2.14.Final
2022-04-25 19:46:23,698 [main] INFO org.xnio - XNIO version 3.8.4.Final
2022-04-25 19:46:23,859 [main] INFO org.jboss.threads - JBoss Threads version 3.1.0.Final
2022-04-25 19:46:23,872 [main] DEBUG io.undertow - Configuring listener with protocol HTTP for interface 0.0.0.0 and port 9630
shadow-cljs - server version: 2.17.0 running at http://localhost:9630
shadow-cljs - nREPL server started on port 7002
shadow-cljs - watching build :app
[:app] Configuring build.
[:app] Compiling ...
[:app] Build completed. (274 files, 273 compiled, 0 warnings, 40,77s)
Alright, so we’re back to my response from 7 days ago, how is lein setup/installed on your system? What directory does it reside in? I wonder if there’s some location that’s in your $PATH in your shell, but not in whatever $PATH that npm uses when running…
ok, I looked after a path variable to set but could not find one. So I simply copied lein from ~/bin/lein (my home dir) to /usr/local/bin and now it found it and it works. Thanks for the answers.