How to Declare Namespace?

I’m (attempting) to build an app with shadow-cljs. Currently, I get the following error, any ideas on the cause and possible solution? Thanks.

Error in phase :compilation
Invalid namespace declaration
– Syntax error -------------------

(… … (:require
[goog.events]
[recipes.components :as components]
[recipes.router]
[metosin/reitit.core :as reitit]
[reagent.core :as reagent]
[re-frame.core :as re-frame]) …)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

has extra input

The complete declaration follows:

(ns recipes.core
  (:require [goog.events]
            [recipes.components :as components]
            [recipes.router]
            [metosin/reitit.core :as reitit]
            [reagent.core :as reagent]
            [re-frame.core :as re-frame])
  (:import [goog.history EventType Html5History]))

I’ve structured the app as follows:

recipes/
| shadow-cljs.edn
| src/
  | recipes/
    | core.cljs

shadow-cljs.edn

{:source-paths
 ["src"]

 :dependencies
 [[cider/cider-nrepl "0.22.4"]
  [reagent "0.8.1"]
  [re-frame "0.10.9"]
  [day8.re-frame/http-fx "v0.2.0"]
  [metosin/reitit "0.3.10"]]

 :nrepl
 {:port 3333}

 :dev-http {8080
            {:root "public"}}

 :builds
 {:app {:target :browser
        :output-dir "public/js"
        :asset-path "/js"
        :modules {:recipes {:init-fn recipes.core/run}}}}}

It should be reitit.core without metosin/.

The error message is a bit weird but it is confused by the qualified symbol which is invalid.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.