Fork me on GitHub
#shadow-cljs
<
2021-06-11
>
Franklin09:06:56

hey @thheller I'm having some trouble with using the repl

apiyo@apiyo-ThinkPad:~/git-repos/<my-repo>$ yarn start-repl
yarn run v1.22.10
$ shadow-cljs cljs-repl app
shadow-cljs - config: /home/apiyo/git-repos/<my-repo>/shadow-cljs.edn
log4j:WARN No appenders could be found for logger (org.jboss.logging).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See  for more info.
shadow-cljs - server version: 2.10.22 running at 
shadow-cljs - nREPL server started on port 3333
WARNING: replace already refers to: #'clojure.core/replace in namespace: ona.utils.helpers, being replaced by: #'clojure.string/replace
WARNING: any? already refers to: #'clojure.core/any? in namespace: chimera.core, being replaced by: #'chimera.core/any?
cljs.user=> (js/console.log "test")
No available JS runtime.
See > 

Franklin09:06:59

my app build looks as follows:

{:app {:asset-path "/js/quagga"
        :modules {:shared
                  {:entries []}
                  :organization
                  {:entries [quagga.components.organization.init]
                   :depends-on #{:shared}}
                  :home
                  {:entries [quagga.components.home.init]
                   :depends-on #{:shared}}
                  ...}
        :output-dir "resources/public/js/quagga/"
        :target :browser
        :devtools {:devtools-url ""}}

Franklin09:06:36

since I'm using a custom HTTP server, I added the :devtools option

Franklin09:06:55

I'm not sure if I followed the user guide instructions correctly

Franklin09:06:39

I've also tried {:devtools-url ""}

Franklin09:06:20

Do I have to build a handler on my server for /shadow-cljs path that proxies requests to http://localhost:9630?

thheller10:06:16

is your server running on the same machine as shadow-cljs?

thheller10:06:44

then you likely don't need to set :devtools-url at all

thheller10:06:30

otherwise you need assuming shadow-cljs is reachable on that location. you can test by just opening it in the browser, you should get the UI

Franklin10:06:20

yes, on the same machine

thheller10:06:20

then you just need to open the generated JS in the browser, no :devtools-url

thheller10:06:30

check the browser console if it connects properly

Franklin11:06:03

in the available runtimes tab

Franklin11:06:10

should I find a cljs runtime

thheller11:06:37

once it is connected yes. check your browser console where you are loading your app.

Franklin11:06:17

still getting the same error

apiyo@apiyo-ThinkPad:~/git-repos/zebra/quagga$ yarn shadow-cljs cljs-repl app
yarn run v1.22.10
$ /home/apiyo/git-repos/zebra/quagga/node_modules/.bin/shadow-cljs cljs-repl app
shadow-cljs - config: /home/apiyo/git-repos/zebra/quagga/shadow-cljs.edn
log4j:WARN No appenders could be found for logger (org.jboss.logging).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See  for more info.
shadow-cljs - server version: 2.10.22 running at 
shadow-cljs - nREPL server started on port 3333
WARNING: replace already refers to: #'clojure.core/replace in namespace: ona.utils.helpers, being replaced by: #'clojure.string/replace
WARNING: any? already refers to: #'clojure.core/any? in namespace: chimera.core, being replaced by: #'chimera.core/any?
cljs.user=> 



(js/console.log "test")
No available JS runtime.
See > 

thheller12:06:02

and what about the browser console?

thheller12:06:21

I don't know what you are doing but what you just pasted is just telling me that no runtime has connected back to shadow-cljs. so you either didn't open the compiled code in the browser OR it failed to connect

thheller12:06:53

I cannot do better here

thheller12:06:55

if you just care about quickly getting a REPL that is NOT related to your "app" you can just use shadow-cljs browser-repl instead. that'll open a browser on its own.

Franklin12:06:51

the browser console seems silent... nothing is logged

thheller12:06:18

there MUST be something logged. either "shadow ready" message OR some kind of error or timeout

thheller12:06:30

I'm assuming here of course you are running a shadow-cljs watch app already

Franklin12:06:59

no, I wasn't running that...

Franklin12:06:03

ok... that's what I was missing