3
votes

I was trying to reference macros in my ClojureScript namespace:

(ns swagger-service.core
(:require [reagent.core :as reagent :refer [atom]]
        [ajax.core :refer [GET]])
(:require-macros [secretary.core :refer [defroute]]))

But I got the following error:

java.lang.RuntimeException
No such var: clojure.core/require-macros
1
Are you sure it is a ClojureScript file (.cljs)? It looks more like Clojure file (.clj). - akond

1 Answers

0
votes

You can find a working example here to clone: https://github.com/cloojure/cljs-template. You probably want a syntax something more like this:

(ns tst.flintstones.pebbles
  (:require
    [clojure.string :as str]
    [flintstones.test-cljs :refer [dotest is isnt is= isnt= testing use-fixtures]] ))

As akond pointed out, it appears you are invoking the Clojure compiler, not the ClojureScript compiler.

Be sure to read and follow the README for the above repo as it is easy to make a mistake setting up the config for a CLJS project.