reagent-project / reagent-template

A Leiningen template for projects using Reagent.
MIT License
394 stars 55 forks source link

noob here: sorry but I can't get autoreload my browser after figwheel recompilation and devcards seems not works for me #125

Closed cocodrino closed 7 years ago

cocodrino commented 7 years ago

Hi, sorry guys I'm a bit noob with clojurescript, I run


lein new reagent testclojurescript +cider +devcards +less

if I run lein figwheel devcardsI get this

lein figwheel devcards                                                                     130   master 
Figwheel: Cutting some fruit, just a sec ...
Figwheel: Validating the configuration found in project.clj
Figwheel: Configuration Valid :)
Figwheel: Starting server at http://0.0.0.0:3441
Figwheel: Watching build - devcards
Compiling "target/cljsbuild/public/js/app_devcards.js" from ["src/cljs" "src/cljc" "env/dev/cljs"]...
WARNING: Use of undeclared Var devcards.core/register-card at line 10 /home/yo/Documentos/proyectos/clojure/pruebaclojurescript/env/dev/cljs/pruebaclojurescript/cards.cljs
WARNING: Use of undeclared Var devcards.core/card-base at line 10 /home/yo/Documentos/proyectos/clojure/pruebaclojurescript/env/dev/cljs/pruebaclojurescript/cards.cljs
WARNING: Bad method signature in protocol implementation, devcards.core/IDevcardOptions does not declare method called -devcard-options at line 10 /home/yo/Documentos/proyectos/clojure/pruebaclojurescript/env/dev/cljs/pruebaclojurescript/cards.cljs
WARNING: Use of undeclared Var devcards.core/IDevcardOptions at line 10 /home/yo/Documentos/proyectos/clojure/pruebaclojurescript/env/dev/cljs/pruebaclojurescript/cards.cljs
WARNING: Symbol devcards.core/IDevcardOptions is not a protocol at line 10 /home/yo/Documentos/proyectos/clojure/pruebaclojurescript/env/dev/cljs/pruebaclojurescript/cards.cljs
WARNING: Use of undeclared Var devcards.core/assert-options-map at line 10 /home/yo/Documentos/proyectos/clojure/pruebaclojurescript/env/dev/cljs/pruebaclojurescript/cards.cljs
WARNING: Use of undeclared Var devcards.core/register-card at line 13 /home/yo/Documentos/proyectos/clojure/pruebaclojurescript/env/dev/cljs/pruebaclojurescript/cards.cljs
WARNING: Use of undeclared Var devcards.core/card-base at line 13 /home/yo/Documentos/proyectos/clojure/pruebaclojurescript/env/dev/cljs/pruebaclojurescript/cards.cljs
WARNING: Bad method signature in protocol implementation, devcards.core/IDevcardOptions does not declare method called -devcard-options at line 13 /home/yo/Documentos/proyectos/clojure/pruebaclojurescript/env/dev/cljs/pruebaclojurescript/cards.cljs
WARNING: Use of undeclared Var devcards.core/IDevcardOptions at line 13 /home/yo/Documentos/proyectos/clojure/pruebaclojurescript/env/dev/cljs/pruebaclojurescript/cards.cljs
WARNING: Symbol devcards.core/IDevcardOptions is not a protocol at line 13 /home/yo/Documentos/proyectos/clojure/pruebaclojurescript/env/dev/cljs/pruebaclojurescript/cards.cljs
WARNING: Use of undeclared Var devcards.core/assert-options-map at line 13 /home/yo/Documentos/proyectos/clojure/pruebaclojurescript/env/dev/cljs/pruebaclojurescript/cards.cljs
Successfully compiled "target/cljsbuild/public/js/app_devcards.js" in 8.91 seconds.
Figwheel: Starting CSS Watcher for paths  ["resources/public/css"]
Figwheel: Starting nREPL server on port: 7002
Launching ClojureScript REPL for build: devcards
Figwheel Controls:
          (stop-autobuild)                ;; stops Figwheel autobuilder
          (start-autobuild [id ...])      ;; starts autobuilder focused on optional ids
          (switch-to-build id ...)        ;; switches autobuilder to different build
          (reset-autobuild)               ;; stops, cleans, and starts autobuilder
          (reload-config)                 ;; reloads build config and resets autobuild
          (build-once [id ...])           ;; builds source one time
          (clean-builds [id ..])          ;; deletes compiled cljs target files
          (print-config [id ...])         ;; prints out build configurations
          (fig-status)                    ;; displays current state of system
  Switch REPL build focus:
          :cljs/quit                      ;; allows you to switch REPL to another build
    Docs: (doc function-name-here)
    Exit: Control+C or :cljs/quit
 Results: Stored in vars *1, *2, *3, *e holds last exception object
Prompt will show when Figwheel connects to your application

the repl never shows so I can't run (switch-to-build devcards)

2) something similar happens when I run lein figwheel: the files are compiled but the repl never shows, if I go to http://localhost:3449/ I can see the html with some links and stuff but if I change my clojurescript code the browser is not autoreloaded in the browser and I still keep watching the old text...I need then reload my browser (chrome)...

I'd like if you can tell me what am I doing wrong..thank so much guys!!!

yogthos commented 7 years ago

The steps you're following look correct, and I'm actually not able to reproduce the problem locally. I just tried creating a new project using the steps you followed and the app started on localhost:3449. When I modified the source files, the changes were reloaded in the browser. This worked for both devcards and the regular app page. Note that for devcrds you want to use the http://localhost:3449/cards url in the browser.

I notice that you're getting warnings in your build, those shouldn't be there if everything is working correctly. One thing to check would be the version of Leiningen that you have. You can upgrade it by running leing upgrade. I also notice in your console output that the server is running on Figwheel: Starting server at http://0.0.0.0:3441, as opposed to 3449.

cocodrino commented 7 years ago

hi @yogthos it's a bit weird because I tried this other template and works as expected, I'd check in more deep this issue this weekend, maybe upgrading my leiningen and maybe testing with other flags..thank you so much

yogthos commented 7 years ago

no problem and let me know how it goes

alehatsman commented 7 years ago

I also can't reproduce the problem. So maybe close this outdated issue?

yogthos commented 7 years ago

I'm going to close this one, figwheel went through a lot of revisions since the issue was opened. We can reopen if the issue shows up with new versions.