This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-15
Channels
- # beginners (97)
- # boot (54)
- # cider (13)
- # cljs-dev (3)
- # cljsrn (9)
- # clojure (64)
- # clojure-berlin (1)
- # clojure-brasil (119)
- # clojure-dev (3)
- # clojure-france (5)
- # clojure-greece (1)
- # clojure-italy (5)
- # clojure-madison (1)
- # clojure-russia (15)
- # clojure-spec (25)
- # clojure-uk (57)
- # clojurebridge (5)
- # clojurescript (45)
- # code-art (1)
- # community-development (17)
- # cursive (24)
- # datomic (83)
- # emacs (11)
- # fulcro (70)
- # hoplon (7)
- # immutant (3)
- # leiningen (19)
- # luminus (5)
- # lumo (25)
- # onyx (123)
- # other-languages (7)
- # pedestal (2)
- # re-frame (12)
- # ring (15)
- # ring-swagger (51)
- # shadow-cljs (89)
- # spacemacs (23)
- # sql (4)
- # unrepl (57)
- # utah-clojurians (1)
- # vim (1)
hey guys, I 'm trying to load up a cljs namespace in the repl, but I'm getting errors. I'm trying to follow the video on this page: https://medium.com/@roman01la/how-to-create-clojurescript-app-4e38778c4762
I have a cljs file that looks like this:
(ns my-service-cljs.core)
(defn derp [x]
x)
It's named core.cljs in a folder name my_service_cljs
I load up a lein repl and enter
(in-ns 'my-service-cljs.core)
And it returns #object[clojure.lang.Namespace 0x58d3f46a "my-service-cljs.core"]
I'm not sure if that means it worked because it seem like if I type in anything it's that same output.
When I try to call derp some something like (derp 5)
it returns this error:
CompilerException java.lang.RuntimeException: Unable to resolve symbol: derp in this context, compiling:(/private/var/folders/41/b5ntx4mn2mv9qk3jyxnsnk_w0000gn/T/form-init7264055216539684302.clj:1:1)
@derpocious in-ns
doesn't load namespaces - it creates them if they don't exist yet, but it does not load the file. you should use require
first
thanks @noisesmith, when I do (require 'my-service-cljs.core)
I then get this error message:
CompilerException java.lang.RuntimeException: Unable to resolve symbol: require in this context, compiling:(/private/var/folders/41/b5ntx4mn2mv9qk3jyxnsnk_w0000gn/T/form-init7264055216539684302.clj:1:1)
is this the proper syntax?
when a namespace is auto-generated by in-ns
, it doesn't know about clojure.core, you can fix it with (clojure.core/refer-clojure)
then require again
Hmm the results doesn't seem to be any different after I run clojure.core/refer-clojure)
Is there anything else I can try? 🙂
I get Tried to use insecure HTTP repository without TLS, how do I find out which dep is causing it?
@derpocious can you show the transcript from the repl session in a github gist or something?
@gonewest818 there's not much more to it than the error message I posted
Are you in the CLJS repl or the clojure one? Is the path to the file src/my_service_cljs/core.clj
?
Have you changed the project.clj file in any way after the lein-figwheel auto generated it?