aero icon indicating copy to clipboard operation
aero copied to clipboard

With lumo 1.9+, fs dependency is not found

Open dotemacs opened this issue 5 years ago • 1 comments

Summary

I'm seeing an issue when I read an EDN file via aero.core/read-config. It works fine when used on Lumo up to version 1.8.0, regardless if it's aero 1.1.2 or 1.1.3. But from Lumo 1.9.0 and up, an error is thrown. See below for details.

Detailed description

If you create an EDN file:

$ echo "{:foo :bar}" > resources/aha.edn

And from Lumo 1.8, at the REPL, which is started via:

lumo -D aero:1.1.3 -c src:test -d
(require '[aero.core :refer [read-config]])
(read-config "resources/aha.edn")

the EDN file is read as expected.

But from Lumo 1.9+, if you do the same as above, you get this exception:

fs is not defined
         aero$core$read_config_into_tag_wrapper (evalmachine.<anonymous>:829:386)
         Function.aero.core.read_config.cljs$core$IFn$_invoke$arity$2 (evalmachine.<anonymous>:860:61)
         aero$core$read_config (evalmachine.<anonymous>:844:30)
         Function.aero.core.read_config.cljs$core$IFn$_invoke$arity$1 (evalmachine.<anonymous>:865:30)
         aero$core$read_config (evalmachine.<anonymous>:848:30)
         (evalmachine.<anonymous>:1:23)
         Script.runInThisContext (vm.cljs:90:20)
         Object.runInThisContext (vm.cljs:297:38)
         (Object.It)
         (Object.lumo.repl.caching_node_eval)

At first I thought that it might be the change that was introduced in this PR https://github.com/juxt/aero/pull/59/files, but trying fs, requiring it the same way, in Lumo 1.9.0 & Lumo 1.10.1, it works fine for reading an EDN file:

cljs.user=> (require '["fs" :as fs])
nil
cljs.user=> (fs/readFileSync "resources/aha.edn" "utf-8")
"{:foo :bar}\n"

Any hints as to what could be causing this?

Thanks

dotemacs avatar Oct 27 '19 19:10 dotemacs

I've had a brief look, but I've no idea what's wrong. We could potentially replace it with a js/require, but that's a workaround rather than understanding.

SevereOverfl0w avatar Oct 27 '19 21:10 SevereOverfl0w