Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

With lumo 1.9+, fs dependency is not found #80

Open
dotemacs opened this issue Oct 27, 2019 · 1 comment
Open

With lumo 1.9+, fs dependency is not found #80

dotemacs opened this issue Oct 27, 2019 · 1 comment

Comments

@dotemacs
Copy link

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

@SevereOverfl0w
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants