Hi, I am new to Clojure and am following this tutorial to make a Clojure API. This uses Cursive plugin in IntelliJ, but I am using Calva in VS Code.
This is my project structure:
.
├── deps.edn
├── resources
│ └── config.edn
└── src
└── clojure_api
├── config.clj
└── core.clj
My config.clj
file contents:
(ns clojure-api.config
(:require [aero.core :as aero]
[clojure.java.io :as io]))
(defn read-config []
(-> "config.edn"
(io/resource)
(aero/read-config)))
I changed my deps.edn file to add the paths src
& resources
like this:
{:deps {aero/aero {:mvn/version "1.1.6"}} :path ["resources" "src"]}
while keeping the config.edn
file an empty map: {}
. However, I could not read the config file from read-config
function in config.clj
. It gave this error in Calva repl:
; Execution error (IllegalArgumentException) at aero.core/read-config-into-tagged-literal (core.cljc:194).
; Cannot open <nil> as a Reader.
The tutorial solved this error in Cursive by refreshing the project structure. I cannot seem to find any such commands in Calva. How can I update/refresh my project structure in Calva so that the deps.edn
changes are reflected in the repl?
I have tried to restart the repl, reopening the folder in VS code, shuffling the resources
directory around to no avail.
I could not find related answers to this problem after googling, so any help will be appreciated.