Fork me on GitHub

with figwheel-main, do I need to include something in my figwheel-main.edn that indicates that it should actually perfom the hooks I have defined? I have an ns with ^:figwheel-hooks and a function with ^:after-load, but when it recompiles, it doesn't run those functions :/ interestingly, if I just put a call to the function in the namespace, it will call it as it re-evals the compiled js so I just drop a (-main) at the bottom of the main file seems a little primitive


@idiomancy I just came to ask a question about the figwheel hooks too. I have my hooks in main.cljs, and when I modify ajax.cljs, I see the figwheel spinner, but my after-load function is not called.


well, as a workaround, you can just manually call the main function lol


Actually, I think my bug is unrelated. I'm not seeing [Figwheel] loaded (tutorial.moan.frontend.ajax), but I am seeing [Figwheel] loaded (tutorial.moan.frontend.main) in the logs. So I guess it's not loading the ns for some reason :thinking_face:

Braden Shepherdson21:01:14

try a lein clean? I've had weird problems like that if I've changed the namespace or restructured the project's directories.


I've seen this on 2 machines today, I'm assuming it's a problem with the environment I've created.


oh, and in 2 different projects. But could be possible, trying 🙂


No. Still no luck 😞


Hmm, poking at internals, I ran this comment tweaked to my project:

(let [compile-env (atom (first (vals @last-compiler-env)))]
    (binding [env/*compiler* compile-env]
      (paths->namespaces-to-reload [(.getCanonicalPath (io/file "src/tutorial/moan/frontend/ajax.cljs"))])

I notice that (:sources @env/*compiler*) only includes my main.cljs, not my ajax.cljs. And also that I get no results back.


Ah, that was the clue I needed 🙂 Looks like it's the result of having :build-inputs set to :main.

dominicm22:01:07 I don't feel like this trade-off is mentioned here really. Is this intentional (and needs docs) or a bug?

👆 5