no that error message has gone - now it only says [Figwheel] did not load (namespaces)
I have :mvn/version
"0.1.8-SNAPSHOT" for figwheel-core and main in my deps.edn
but I get the same results
I looked in figwheel-core's github repo for a SHA to point at but the last commit was 7 days ago
I added ^:figwheel-load
to the namespaces I'm changing but no change
ok I cloned figwheel-core and overrode in my deps.edn to use the cloned local version and now I get the previous error
Figwheel:FINE] Detected changed cljs files: ("/my/ui/views.cljs")
[Figwheel] Compiling build dev to "public/js"
[Figwheel] Failed to compile build dev in 2.818 seconds.
[Figwheel] Compile Exception: Don't know how to write JSON of class java.net.URL
[Figwheel:SEVERE] java.lang.Exception: Don't know how to write JSON of class java.net.URL
[Figwheel:FINE] {:cause "Don't know how to write JSON of class java.net.URL",
:via
[{:type java.lang.Exception,
:message "Don't know how to write JSON of class java.net.URL",
:at [clojure.data.json$write_generic invokeStatic "json.clj" 385]}],
:trace
[[clojure.data.json$write_generic invokeStatic "json.clj" 385]
[clojure.data.json$write_generic invoke "json.clj" 382]
[clojure.data.json$fn__2717$G__2712__2724 invoke "json.clj" 286]
[clojure.data.json$write_object invokeStatic "json.clj" 335]
[clojure.data.json$write_object invoke "json.clj" 319]
[clojure.data.json$fn__2717$G__2712__2724 invoke "json.clj" 286]
[clojure.data.json$write_array invokeStatic "json.clj" 348]
[clojure.data.json$write_array invoke "json.clj" 342]
[clojure.data.json$fn__2717$G__2712__2724 invoke "json.clj" 286]
[clojure.data.json$write invokeStatic "json.clj" 475]
[clojure.data.json$write doInvoke "json.clj" 424]
[clojure.lang.RestFn invoke "RestFn.java" 425]
[clojure.lang.AFn applyToHelper "AFn.java" 156]
[clojure.lang.RestFn applyTo "RestFn.java" 132]
[clojure.core$apply invokeStatic "core.clj" 661]
[clojure.core$apply invoke "core.clj" 652]
[clojure.data.json$write_str invokeStatic "json.clj" 482]
[clojure.data.json$write_str doInvoke "json.clj" 477]
[clojure.lang.RestFn invoke "RestFn.java" 410]
[figwheel.core$compiler_warnings_code invokeStatic "core.cljc" 657]
[figwheel.core$compiler_warnings_code invoke "core.cljc" 655]
[figwheel.core$handle_warnings invokeStatic "core.cljc" 661]
[figwheel.core$handle_warnings invoke "core.cljc" 659]
[figwheel.core$start_STAR_$fn__4222 invoke "core.cljc" 781]
[clojure.lang.ARef notifyWatches "ARef.java" 81]
[clojure.lang.Atom swap "Atom.java" 83]
[clojure.core$swap_BANG_ invokeStatic "core.clj" 2347]
[clojure.core$swap_BANG_ doInvoke "core.clj" 2337]
[clojure.lang.RestFn invoke "RestFn.java" 497]
[figwheel.core$eval4238$build__4240 doInvoke "core.cljc" 841]
...
I get this error each time I edit this file, but it does compile because if I reload the page I see the changes
@octo221 I didn’t push the change to the repo
I just pushed the debugging code
@octo221 This is fantastic. Now I know its data that’s in the warning. If you check out the latest figwheel-core and use it we should also see the actual data that is causing the error. I’m going to look at the warning data processing right now to see what the problem could be.
@octo221 there is a :load-warninged-code
option that will load the code even when warnings are detected and this may help in the short term? https://figwheel.org/config-options#load-warninged-code
@octo221 ok I just pushed a fix for this to figwheel-core, it should make the exception go away
hi, I've cloned figwheel-core & am using it locally in my deps.edn (figwheel-core's deps.edn needs a :paths
key)
I still get the error though
i checked I'm definitely using the local clone by changing the log message on line 304
sorry to be clear I still get the 'did not load' error not the JSON one
right - I've added ^:figwheel-load
to the namespace I'm changing (I'm change the colour of something), and I've added some debug messages to figwheel-core in reload-namespaces, and I see that after I make a change, namespaces
has 4 of my namespaces including the one I've changed, but to-reload
is empty
@octo221 OK so the JSON Error is no longer the problem and now we are having problems with reloading in general. I’m going to check out the reloading behavior for dynamically loaded modules
I really appreciate you reporting this so that I can get to the bottom of this
we’ve plugged one rare bug… let’s see if we can find the other one
ok I fixed a problem in a third-party lib that was causing a compilation warning about a single-segment namespace
and then I restarted figwheel main
now get this:
loading module my client core.cljs:192:16
log:Module loaded: cljs_base logger.js:367:5
[goog.module.ModuleManager] Module loaded: cljs_base console.js:203:5
log:Module loaded: client logger.js:367:5
[goog.module.ModuleManager] Module loaded: client console.js:203:5
> [my.ui.views my.ui.ui my.ui.module] core.cljs:192:16
> [my.ui.views my.ui.ui my.ui.module my.ui.main] core.cljs:192:16
log:loaded (my.ui.views my.ui.ui my.ui.module) logger.js:367:5
[Figwheel] loaded (my.ui.views my.ui.ui my.ui.module) console.js:203:5
log:really did not load (my.ui.main) logger.js:367:5
[Figwheel] really did not load (my.ui.main) console.js:203:5
- the > lines are to-reload and namespace respectivelyand, it actually does reload but I have to force it to update by interacting with the UI somehow
e.g. if I change the size of something normally with lein-figwheel it would update and I would see the result, but here it updates and I only see the result after I do something in the UI to make react update
on the same codebase?
meaning when you used this codebase with line-figwheel it updated as you would expect?
or is this a different codbase?
@octo221 you probably need a reload hook to touch your atom to force a rerender
yes with this codebase lein-figwheel works fine
yeah but you had a reload hook for lein-figwheel probably right?
:on-js-reload ?
ummm
oh let me check
and for figwheel-main you would use https://figwheel.org/docs/hot_reloading.html#reload-hooks
ahah yes in project.clj I had :before-jsload and :on-jsload
so go ahead and use the new reloading mechanism and you should be good
and here’s a reminder to use https://figwheel.org/config-options#load-warninged-code
when you have a warning that is preventing reloads
and it works!
got it - thank you so much for all your help!
i completely forgot about :on-load
when I switched to deps.edn