Fork me on GitHub
#figwheel
<
2018-12-23
>
tim21:12:48

First day with Figwheel. Not using figwheel-main, but I am using figwheel+piggback+rebl. Got the cljs-repl up and tried calling fn using a qualified ns i.e (app.main/some-fn). It works, but it’s barfing compiler warnings about it being an undeclared var. Is there a fix to this that does not involve turning warnings off?

tim21:12:46

and maybe a way to call functions without qualifying them (which doesn’t work for me)

phill21:12:14

If you situate the REPL in the function's ns, as with (in-ns 'app.main), then you can call (some-fn) like that. But that is just a question of spelling, really. It's probably not related to compiler warnings.

phill21:12:36

Did you try clearing out the js directory (I mean the place where cljs compiles to) and doing a fresh compile, just to be sure detritus from earlier isn't complicating things?

tim21:12:07

yeah, being in the ns works for direct calls now, but it’s not just spelling for qualified calls since the call actually gets triggered and I can see the result in the browser.

tim21:12:07

yeah, I’ve purged all files and have run lein-cljsbuild again… is that what you mean?

tim22:12:38

thanks phil, got it working… first day glitches. I was calling the function from user.cljs. I’m guessing it’s because that user.cljs doesn’t have access to my ns because they are not included. switched to app.main and then calling other included namespace fns works. what threw me off was that the original fn call from user actually worked, but emitted the warning.