Fork me on GitHub
#beginners
<
2015-07-13
>
arathunku19:07:53

Hey, anyone could help me with an error about missing namespace? my project.clj looks like this: https://github.com/arathunku/game-fun/blob/feature/figwheel-cljs/tiled-mmo/server/project.clj and when I start repl and run (reset) from https://github.com/arathunku/game-fun/blob/feature/figwheel-cljs/tiled-mmo/server/env/dev/clj/tilet/repl.clj#L2 I get:

(reset)
:reloading (tilet.domain.extensions.transfer-data tilet.domain.ientity tilet.domain.player tilet.components.players-connections tilet.site.main_page tilet.site.site tilet.domain.mob tilet.components.game-loop tilet.components.map tilet.components.mobs_connections tilet.handler tilet.system tilet.repl)
:error-while-loading tilet.repl
=> #error {
 :cause "No namespace: tilet.system"
 :via
 [{:type clojure.lang.Compiler$CompilerException
   :message "java.lang.Exception: No namespace: tilet.system, compiling:(tilet/repl.clj:1:1)"
   :at [clojure.lang.Compiler load "Compiler.java" 7239]}
  {:type java.lang.Exception
   :message "No namespace: tilet.system"
   :at [clojure.core$refer doInvoke "core.clj" 4080]}]
 :trace

arathunku19:07:46

but in repl, I can switch to that namespace.

*ns*
=> #object[clojure.lang.Namespace 0x585e7d43 "tiled.system"]

arathunku19:07:32

sorry, I can't switch to it in repl too

CompilerException java.lang.Exception: namespace 'tilet.system' not found, 

arathunku19:07:17

Is there anything specific required in project.clj to make it work?

surreal.analysis19:07:10

Hmm, is it related to :gen-class? That may make it a class, not a namespace

surreal.analysis19:07:34

But I’m honestly not sure - haven’t used :gen-class before

arathunku19:07:35

Yay, success! Thanks @surreal.analysis. Beginner once again bitten by bad error msgs. 😕

arathunku19:07:53

Hmm... another error with namespaces... Do I have to scope them in clj? https://github.com/arathunku/game-fun/blob/feature/figwheel-cljs/tiled-mmo/server/src/clj/tilet/system.clj#L3 https://github.com/arathunku/game-fun/blob/feature/figwheel-cljs/tiled-mmo/server/src/clj/tilet/handler.clj#L1

EPL server started on port 48821 on host 127.0.0.1 - 
(reset)
:reloading (tilet.domain.extensions.transfer-data tilet.domain.ientity tilet.domain.player tilet.components.players-connections tilet.site.main-page tilet.site tilet.domain.mob tilet.components.game-loop tilet.components.map tilet.components.mobs_connections tilet.handler tilet.system tilet.repl)
:error-while-loading tilet.system
=> #error {
 :cause "No namespace: tilet.handler"
 :via
 [{:type clojure.lang.Compiler$CompilerException
   :message "java.lang.Exception: No namespace: tilet.handler, compiling:(tilet/system.clj:1:1)"
   :at [clojure.lang.Compiler load "Compiler.java" 7239]}
  {:type java.lang.Exception
   :message "No namespace: tilet.handler"
   :at [clojure.core$refer doInvoke "core.clj" 4080]}]
 :trace

surreal.analysis19:07:33

What caused the error?

arathunku19:07:21

Previously, gen-class. Now I'm trying to (reset)

arathunku19:07:12

As it turns out, I had to do lein clean after removing gen-class. thanks @annapawlicka