kendru / learn-cljs

Source code for Learn ClojureScript
64 stars 27 forks source link

Problems in "Hello World" example #67

Closed Nuube closed 1 year ago

Nuube commented 2 years ago

I run in two issues on the first sample "Hello World" project. Probably not worth to mention I am a complete newbie.

Firstly the compiler issues a waring;

clj -m cljs.main --compile my-cljs-project.core --repl

WARNING: Implicit use of clojure.main with options is deprecated, use -M

(This is just a warning, so assume it not important)

However then:

Unexpected error (IllegalArgumentException) compiling at (REPL:1).
Namespace my-cljs-project.core does not exist. Please check that namespaces with dashes use underscores in the ClojureScript file name.

Full report at:
/tmp/clojure-10909136938130212425.edn

Namespace my-cljs-project.core does not exist. Please check that namespaces with dashes use underscores in the ClojureScript file name.

This is an error and the sample does not compile.

(BTW: From the text it is not complete clear whether you need to put the index.html in the root directory or in src/)

sevillaarvin commented 2 years ago

Hi, for the first question, according to the quick start guide, https://clojurescript.org/guides/quick-start, the command should be (note the -M):

clj -M --main cljs.main --compile my-cljs-project.core --repl

For the second question, perhaps you did not include the paths in your deps.edn? Anyway here is a repository as described in the book:

https://github.com/sevillaarvin/learn-cljs-hello-world