datodev / dato

Experiment in distilling apps to their essence
Eclipse Public License 1.0
168 stars 8 forks source link

Notes from setting dato up from scratch #18

Closed atroche closed 9 years ago

atroche commented 9 years ago

Hi @sgrove,

I'm excited about playing around with dato — seems like the future. I've got it running, but had a few problems along the way. After I cloned, I tried to run figwheel and got:

dato/ on master 
› lein figwheel
Possibly confusing dependencies found:
[lein-cljsbuild "1.0.6" :exclusions [org.clojure/clojurescript]] -> [lein-cljsbuild/cljs-compat "1.0.0-SNAPSHOT"] -> [org.clojure/clojure "1.5.1"]
 overrides
[lein-ancient "0.6.7"] -> [version-clj "0.1.2"] -> [org.clojure/clojure "1.6.0"]
 and
[lein-ancient "0.6.7"] -> [ancient-clj "0.3.9" :exclusions [com.amazonaws/aws-java-sdk-s3]] -> [org.clojure/clojure "1.6.0" :exclusions [joda-time org.clojure/clojure]]
 and
[lein-ancient "0.6.7"] -> [rewrite-clj "0.4.12"] -> [org.clojure/clojure "1.6.0" :exclusions [org.clojure/clojure]]

Consider using these exclusions:
[lein-ancient "0.6.7" :exclusions [org.clojure/clojure]]
[lein-ancient "0.6.7" :exclusions [org.clojure/clojure]]
[lein-ancient "0.6.7" :exclusions [org.clojure/clojure]]

Aborting due to :pedantic? :abort

I made the suggested changes, and the dependencies resolve fine. But now:

› rlwrap lein figwheel     
Figwheel: Starting server at http://localhost:3449
Focusing on build ids: dev
Compiling "resources/public/js/bin-debug/main.js" from ["src/cljs" "src/shared/" "yaks/datascript/src" "yaks/datascript/bench/src"]...
Compiling "resources/public/js/bin-debug/main.js" failed.
clojure.lang.ExceptionInfo: failed compiling file:src/cljs/dato/lib/db.cljs
 at clojure.core$ex_info.invoke (core.clj:4593)
Caused by: clojure.lang.ExceptionInfo: No such namespace: datascript, could not locate datascript.cljs, datascript.cljc, or Closure namespace "datascript" at line 1 src/cljs/dato/li
b/db.cljs
 at clojure.core$ex_info.invoke (core.clj:4593)

WARNING: update already refers to: #'clojure.core/update in namespace: plumbing.core, being replaced by: #'plumbing.core/update
WARNING: update already refers to: cljs.core/update being replaced by: plumbing.core/update at line 53 file:/Users/aroche/.m2/repository/prismatic/plumbing/0.4.0/plumbing-0.4.0.jar!
/plumbing/core.cljs
clojure.lang.ExceptionInfo: No such namespace: datascript, could not locate datascript.cljs, datascript.cljc, or Closure namespace "datascript" at line 1 /Users/aroche/Code/clj/dato
/src/cljs/dato/lib/db.cljs {:file "/Users/aroche/Code/clj/dato/src/cljs/dato/lib/db.cljs", :line 1, :column 1, :tag :cljs/analysis-error}
        at clojure.core$ex_info.invoke(core.clj:4593)
        at cljs.analyzer$error.invoke(analyzer.cljc:384)
        at cljs.analyzer$error.invoke(analyzer.cljc:382)
        at cljs.analyzer$analyze_deps.invoke(analyzer.cljc:1293)
        at cljs.analyzer$eval1679$fn__1681.invoke(analyzer.cljc:1545)
        at clojure.lang.MultiFn.invoke(MultiFn.java:251)
        at cljs.analyzer$analyze_seq.invoke(analyzer.cljc:1900)
        at cljs.analyzer$analyze$fn__1929.invoke(analyzer.cljc:1992)
        at cljs.analyzer$analyze.invoke(analyzer.cljc:1985)
        at cljs.analyzer$analyze_file$fn__1980.invoke(analyzer.cljc:2232)
        at cljs.analyzer$analyze_file.invoke(analyzer.cljc:2227)
        at cljs.analyzer$analyze_deps.invoke(analyzer.cljc:1291)
        at cljs.analyzer$eval1679$fn__1681.invoke(analyzer.cljc:1545)
        at clojure.lang.MultiFn.invoke(MultiFn.java:251)
        at cljs.analyzer$analyze_seq.invoke(analyzer.cljc:1900)
        at cljs.analyzer$analyze$fn__1929.invoke(analyzer.cljc:1992)
        at cljs.analyzer$analyze.invoke(analyzer.cljc:1985)
        at cljs.analyzer$analyze_file$fn__1980.invoke(analyzer.cljc:2232)
        at cljs.analyzer$analyze_file.invoke(analyzer.cljc:2227)
        at cljs.analyzer$analyze_deps.invoke(analyzer.cljc:1291)
        at cljs.analyzer$eval1679$fn__1681.invoke(analyzer.cljc:1545)
        at clojure.lang.MultiFn.invoke(MultiFn.java:251)
        at cljs.analyzer$analyze_seq.invoke(analyzer.cljc:1900)
        at cljs.analyzer$analyze$fn__1929.invoke(analyzer.cljc:1992)
        at cljs.analyzer$analyze.invoke(analyzer.cljc:1985)
        at cljs.analyzer$analyze_file$fn__1980.invoke(analyzer.cljc:2232)
        at cljs.analyzer$analyze_file.invoke(analyzer.cljc:2227)
        at figwheel_sidecar.repl$analyze_build.invoke(repl.clj:252)
        at figwheel_sidecar.repl$analyze_builds.invoke(repl.clj:257)
        at figwheel_sidecar.repl$run_autobuilder_helper.invoke(repl.clj:305)
        at figwheel_sidecar.repl$start_autobuild.invoke(repl.clj:376)
        at figwheel_sidecar.repl$run_autobuilder.invoke(repl.clj:535)
        at user$eval22223.invoke(form-init5551763719784528989.clj:1)
        at clojure.lang.Compiler.eval(Compiler.java:6782)
        at clojure.lang.Compiler.eval(Compiler.java:6772)
        at clojure.lang.Compiler.load(Compiler.java:7227)
        at clojure.lang.Compiler.loadFile(Compiler.java:7165)
        at clojure.main$load_script.invoke(main.clj:275)
        at clojure.main$init_opt.invoke(main.clj:280)
        at clojure.main$initialize.invoke(main.clj:308)
        at clojure.main$null_opt.invoke(main.clj:343)
        at clojure.main$main.doInvoke(main.clj:421)
        at clojure.lang.RestFn.invoke(RestFn.java:421)
        at clojure.lang.Var.invoke(Var.java:383)
        at clojure.lang.AFn.applyToHelper(AFn.java:156)
        at clojure.lang.Var.applyTo(Var.java:700)
        at clojure.main.main(main.java:37)
Subprocess failed

Running git submodule init && git submodule update solved this.

Also, I only needed the following env vars in my profiles.clj to get lein run working:

           :env          {:is-dev true
                          :datomic-local-uri "datomic:dev://localhost:4334/dato"}

Found out through experimentation that the database name doesn't matter, and doesn't need to exist before you do lein run. And that PORT is the web server port, not DATO_PORT =)

I'm still having a bit of trouble with the nrepl server, but I'll mess around with that when I actually need it.

Might be worth adding a few notes to the README for the next guy who comes along?

Cheers.

sgrove commented 9 years ago

This is awesome, thank you so much for going through this - Daniel and I have fixed up the Readme in the DatodoMVC repo based on this (and some other changes), so hopefully it should be much smoother now.