-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Identified a gotcha which I am sure will come up again so I figured I would at the least provide a starting point to help future users debug
- Loading branch information
1 parent
4231d23
commit 6b0203d
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,31 @@ | ||
# Deploy ClojureScript to Github Pages | ||
|
||
This repo contains demo code for [Blog Post](https://github.com/tkjone/blog/blob/master/src/pages/blog-posts/000-deploy-clojurescript-to-github-pages.md). Live site [here](https://tkjone.github.io/demo-clojurescript-gh-pages/) | ||
|
||
## Gotchas | ||
|
||
For people who are working through the blog post this demo was written for, there are some issues you might run into. Hopefully this section will help to understand and resolve them. | ||
|
||
**dev bundle command returns exception: Could not locate cljs/main\_\_init.class** | ||
|
||
If you ran this command | ||
|
||
```bash | ||
clj -m cljs.main -d "demo-clojurescript-gh-pages/out" -c demo.static-website -r | ||
``` | ||
|
||
You could see an exception like this in your terminal: | ||
|
||
```bash | ||
Exception in thread "main" java.io.FileNotFoundException: Could not locate cljs/main__init.class, cljs/main.clj or cljs/main.cljc on classpath. | ||
``` | ||
|
||
The above command generally means that `clojure` could not find `ClojureScript`. Here are some of the reasons why it might occur and how to resolve the issue: | ||
|
||
- You might be running the command from the wrong dir | ||
|
||
Please be sure that you are running the dev bundle command from the root of the project dir and you have a `deps.edn` file living there. | ||
|
||
- You might not have ClojureScript installed | ||
|
||
The first time you run the command from the correct dir, it should download ClojureScript from maven. However, there are scenarios where `clj` won't try to download ClojureScript. For example, if `clj` sees a `.cpcache` dir, it will not try to download `ClojureScript` again and alway return the above exception. |