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

Can't slurp file with repl eval #77

Open
johnjelinek opened this issue Nov 13, 2017 · 1 comment
Open

Can't slurp file with repl eval #77

johnjelinek opened this issue Nov 13, 2017 · 1 comment

Comments

@johnjelinek
Copy link

Given this code:

(defn process-file [fname]
  (slurp (clojure.java.io/resource fname)))

(process-file "hello.txt")

and this file in resources/hello.txt:

Hello Resources!

When I eval
Then I get a stacktrace:

clojure.lang.Compiler$CompilerException java.lang.IllegalArgumentException: Cannot open <nil> as a Reader.
 at null:69:22
    clojure.lang.Compiler$InvokeExpr.eval (Compiler.java:3657)
    clojure.lang.Compiler$DefExpr.eval (Compiler.java:451)
    clojure.lang.Compiler.eval (Compiler.java:6932)
    clojure.lang.Compiler.load (Compiler.java:7379)
    clojure.lang.Compiler.eval (Compiler.java:6927)
    clojure.lang.Compiler.eval (Compiler.java:6890)
    clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__5508.invoke (interruptible_eval.clj:87)
    clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invokeStatic (interruptible_eval.clj:85)
    clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invoke (interruptible_eval.clj:55)
    clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval$fn__5553$fn__5556.invoke (interruptible_eval.clj:224)
    clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__5548.invoke (interruptible_eval.clj:192)

This works without issue in a lein repl.

@avli
Copy link
Owner

avli commented Mar 10, 2018

@johnjelinek could you check if the issue still persists in the latest version of the extension? It seems like Clojure can't find the file for some reason. Can it be the case that you redefine the Leiningen resource-paths variable somewhere?

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