figwheel-main

figwheel-main http://figwheel.org
cch1 2020-03-02T18:53:55.017400Z

Are there known issues with figwheel-main and loading of data_readers.cljc? I’m seeing figwheel trying to process this special file upon load and of course the symbols do not resolve to any existing vars. Here is data_readers.cljc

{myco/lit myco.lit/read}
And here is what figwheel-main tells me:
No such namespace: myco, could not locate myco.cljs, myco.cljc, or JavaScript source providing "myco"
followed by further errors about using an undeclared var.

Jan K 2020-03-02T21:22:48.019400Z

@cch1 I also had this problem. I think it should start working if you launch figwheel-main via the scripting API (ie. figwheel.main.api/start) directly from your REPL, where the required namespaces will already be loaded before figwheel starts.

cch1 2020-03-02T21:24:33.020900Z

Thanks, @jkr.sw. First step is realizing one is not crazy. A nice solution can come later. For me, launching via the scripting API is not ideal. I was hoping to find an option to omit loading a file (not *re*loading) but I can’t find such a thing.

cch1 2020-03-02T21:26:06.022100Z

(my guess is that figwheel is sending data_readers.cljc to the repl to be evaluated because it is in the “no namespace” category that might be the default before switching to cljs.user)

Jan K 2020-03-02T21:31:27.025Z

I'm not sure what exactly is happening, but I'm happy there's a way to make it work with figwheel, since for example shadow-cljs explicitly doesn't support data_readersat all (https://github.com/thheller/shadow-cljs/issues/272 )

👍 1
kkruit 2020-03-02T21:32:44.026600Z

Is there a way to configure figwheel/clj to build js files not at a root in public eg http://localhost/myapp/index.html , http://localhost/myapp/main.js ect.

kkruit 2020-03-02T21:34:39.027200Z

is it just a matter of changing your :output-to and :output-dir?

kkruit 2020-03-02T22:06:50.027700Z

looks like yes in combination with :asset-path. thanks!