Fork me on GitHub
#humbleui
<
2022-12-14
>
Simun Karacic16:12:56

Hey, I'm trying to run the TODO MVC example as a starting point to making my own thing. What I've done is: • Clone the humble-starter repo • Copy the contents of into main.clj • Added *todomvc-state from to state.clj After that, I try to run the app, and run into issues I'm not sure how to solve. The humble-starter points to this commit of humbleui: c3eb2ec04fcccb40cc4a3da44ccda0ef3ccacc01 And when running with that version, i get the following:

Execution error (FileNotFoundException) at town.lilac.humble.app.main/eval138$loading (main.clj:1).
Could not locate io/github/humbleui/cursor__init.class, io/github/humbleui/cursor.clj or io/github/humbleui/cursor.cljc on classpath.
Ok, no problem, I'll move the commit to https://github.com/HumbleUI/HumbleUI/commit/223fb2c60e9b7067cfc0c899015b70d68a29e5c5, where cursor was created. Then I get the following error:
Syntax error compiling at (town/lilac/humble/app/main.clj:107:9).
No such var: ui/shadow
Ok, then let's move https://github.com/HumbleUI/HumbleUI/commit/d75564ad1b11f5415124e2f4857a4e71e27770ba, where shadow was created. But on that commit (and all subsequent commits), i get the following error:
Execution error (NullPointerException) at clojure.main/main (main.java:40).
null
And the full report:
{:clojure.main/message
 "Execution error (NullPointerException) at clojure.main/main (main.java:40).\nnull\n",
 :clojure.main/triage
 {:clojure.error/class java.lang.NullPointerException,
  :clojure.error/line 40,
  :clojure.error/symbol clojure.main/main,
  :clojure.error/source "main.java",
  :clojure.error/phase :execution},
 :clojure.main/trace
 {:via
  [{:type java.lang.NullPointerException,
    :at [clojure.core$apply invokeStatic "core.clj" 667]}],
  :trace
  [[clojure.core$apply invokeStatic "core.clj" 667]
   [clojure.main$main_opt invokeStatic "main.clj" 514]
   [clojure.main$main_opt invoke "main.clj" 510]
   [clojure.main$main invokeStatic "main.clj" 664]
   [clojure.main$main doInvoke "main.clj" 616]
   [clojure.lang.RestFn applyTo "RestFn.java" 137]
   [clojure.lang.Var applyTo "Var.java" 705]
   [clojure.main main "main.java" 40]]}}
Any ideas on what I could do to get it up and running? This framework looks amazing btw, that's why I'm trying so hard to run it 🙂

Niki18:12:24

not much to work with. Can you determine somehow where NPE is happening?

Niki18:12:54

One common mistake I often make is that default-theme should wrap everything

Niki18:12:23

not sure if it was there when humble-starter was written, check it anyway

Simun Karacic18:12:13

I’ve wrapped everything with that, but I could be wrong, I’m very new to clojure. Here’s the repo and branch main-skara with this code https://github.com/SimunKaracic/humble-starter/tree/main-skara

Simun Karacic18:12:20

Same result btw:

{:clojure.main/message
 "Execution error (NullPointerException) at clojure.main/main (main.java:40).\nnull\n",
 :clojure.main/triage
 {:clojure.error/class java.lang.NullPointerException,
  :clojure.error/line 40,
  :clojure.error/symbol clojure.main/main,
  :clojure.error/source "main.java",
  :clojure.error/phase :execution},
 :clojure.main/trace
 {:via
  [{:type java.lang.NullPointerException,
    :at [clojure.core$apply invokeStatic "core.clj" 667]}],
  :trace
  [[clojure.core$apply invokeStatic "core.clj" 667]
   [clojure.main$main_opt invokeStatic "main.clj" 514]
   [clojure.main$main_opt invoke "main.clj" 510]
   [clojure.main$main invokeStatic "main.clj" 664]
   [clojure.main$main doInvoke "main.clj" 616]
   [clojure.lang.RestFn applyTo "RestFn.java" 137]
   [clojure.lang.Var applyTo "Var.java" 705]
   [clojure.main main "main.java" 40]]}}
I’ll try and figure out where the NPE is happening and try to figure something out

Niki01:12:11

Wait, run.sh doesn’t work? That’s because you don’t have -main function in main.clj

Simun Karacic10:12:59

Aaand that fixed it. Thank you!

(defn -main
  "Run once on app start, starting the humble app."
  [& args]
  (ui/start-app!
   (reset! state/*window
           (ui/window
            {:title    "Todo MVC"}
            #'app)))
  (state/redraw!))

lilactown04:12:55

PR welcome to fix any issues!

Simun Karacic07:12:26

No issues with the humble-starter itself (all pain was self inflicted), just that to use the current example code, you need the latest version of HumbleUI. I can bump the commit hash in deps.edn and check the starter still works, if that's something you're interested in!