Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

domina creating errors #245

Closed
hlolli opened this issue Dec 23, 2015 · 9 comments
Closed

domina creating errors #245

hlolli opened this issue Dec 23, 2015 · 9 comments

Comments

@hlolli
Copy link

hlolli commented Dec 23, 2015

After starting tutorial number 5, depending on domina, I started getting errors (by the way, thanks so much for these tutorials, AMAZING!)

When starting boot dev, it starts but reports this error:
java.util.concurrent.ExecutionException: java.nio.file.NoSuchFileException: target/js/main.out/cljs_deps.js
java.nio.file.NoSuchFileException: target/js/main.out/cljs_deps.js
(added: this only occours after connecting the bREPL, not sure there's any link to the domina problem)
In bREPL:

cljs.user=> (require '[domina.core :refer [by-id value set-value!]] :reload)
nil

causes in chrome jsconsole:

GET http://localhost:3000/js/main.out/goog/dom/inputtype.js jsloader.js:210
(and more similar with red x's)

but it does find the doc on domin in bREPL

cljs.user=> (doc by-id)

cljs.user/by-id
([id])
Returns content containing a single node by looking up the given ID

But following the tutorial...

cljs.user=> (by-id "email")

object[ReferenceError ReferenceError: domina is not defined]

ReferenceError: domina is not defined
at eval (eval at (http://localhost:3000/js/main.out/weasel/repl.js:30:470), :1:89)
at eval (eval at (http://localhost:3000/js/main.out/weasel/repl.js:30:470), :9:3)
at eval (eval at (http://localhost:3000/js/main.out/weasel/repl.js:30:470), :14:4)
at http://localhost:3000/js/main.out/weasel/repl.js:30:465
at http://localhost:3000/js/main.out/weasel/repl.js:39:4
at cljs.core.MultiFn.call.G__9227__2 (http://localhost:3000/js/main.out/cljs/core.js:31994:106)
at cljs.core.MultiFn.call.G__9227 as call
at null. (http://localhost:3000/js/main.out/weasel/repl.js:184:71)
at goog.events.EventTarget.fireListeners (http://localhost:3000/js/main.out/goog/events/eventtarget.js:284:23)
at Function.goog.events.EventTarget.dispatchEventInternal_ (http://localhost:3000/js/main.out/goog/events/eventtarget.js:381:26)

also; you said in the tutorial earlier you were using emacs, as clojure user (JVM) I thought I could connect to nrepl with M-x cider-connect but this is not the case, maybe you could share some info (or link me) to where I can connect to the boot-nrepl with cider.

thanks for the tutorial,
best Hlödver

ps. my build.boot file:

(set-env!
:source-paths #{"src/cljs"}
:resource-paths #{"html"}

:dependencies '[[org.clojure/clojure "1.7.0"]
[org.clojure/clojurescript "1.7.170"]
[adzerk/boot-cljs "1.7.170-3"]
[pandeiro/boot-http "0.7.0"]
[adzerk/boot-reload "0.4.2"]
[adzerk/boot-cljs-repl "0.3.0"]
[com.cemerick/piggieback "0.2.1"] ;; needed by bREPL
[weasel "0.7.0"] ;; needed by bREPL
[org.clojure/tools.nrepl "0.2.12"] ;; needed by bREPL
[org.clojars.magomimmo/domina "2.0.0-SNAPSHOT"]])

(require '[adzerk.boot-cljs :refer [cljs]]
'[pandeiro.boot-http :refer [serve]]
'[adzerk.boot-reload :refer [reload]]
'[adzerk.boot-cljs-repl :refer [cljs-repl start-repl]])

(deftask dev
"Blasta öllu af stað!"
[](comp
%28serve :dir)
(watch)
(reload)
(cljs-repl)
(cljs)))

@hlolli
Copy link
Author

hlolli commented Dec 23, 2015

Doing:

git clone https://github.com/magomimmo/modern-cljs.git
cd modern-cljs
git checkout se-tutorial-05

solved this, so must have been error somewhere that I didn't spot. Close it.

@hlolli hlolli closed this as completed Dec 23, 2015
@magomimmo
Copy link
Owner

never mind. if you want to spot the error, assuming you start working on tutorial-05 from the se-tutorial-04, you can git diff with se-tutorial-05

  • step 1
git clone https://github.com/magomimmo/modern-cljs.git
cd modern-cljs
git checkout se-tutorial-04
  • step 2 - fowllow tutorial-05
  • step 3
git diff se-tutorial-05

HIH

@frap
Copy link

frap commented Jan 7, 2016

I am having the same error. I was working through my own version then changed to checkout se-tutorial-04 as soon as I change the build.bot to reference domina - your snapshot or the old domina 1.0.3 I get the same error in the b-repl after (require '[domina :refer [by-id value set-value!]] :reload) (this one is old single segment namespace)
(by-id "email")

#object[ReferenceError ReferenceError: domina is not defined]
ReferenceError: domina is not defined
at eval (eval at (http://localhost:3000/js/main.out/weasel/repl.js:30:470), :1:89)
at eval (eval at (http://localhost:3000/js/main.out/weasel/repl.js:30:470), :9:3)
at eval (eval at (http://localhost:3000/js/main.out/weasel/repl.js:30:470), :14:4)
at http://localhost:3000/js/main.out/weasel/repl.js:30:465
at http://localhost:3000/js/main.out/weasel/repl.js:39:4
at cljs.core.MultiFn.call.G__9227__2 (http://localhost:3000/js/main.out/cljs/core.js:31994:106)
at cljs.core.MultiFn.call.G__9227 as call
at null. (http://localhost:3000/js/main.out/weasel/repl.js:184:71)
at goog.events.EventTarget.fireListeners (http://localhost:3000/js/main.out/goog/events/eventtarget.js:284:23)
at Function.goog.events.EventTarget.dispatchEventInternal_ (http://localhost:3000/js/main.out/goog/events/eventtarget.js:381:26)

@frap
Copy link

frap commented Jan 7, 2016

hmm interesting following the tutorial it all fails as you need to put the (:require [domina.core :refer [by-id value]])) in the login.cljs form and then domina works . using the require for the b-repl without this it doesnt work?

@frap
Copy link

frap commented Jan 7, 2016

ahh tutorial 7 outlines the issue - NOTE 2: Due to a bug of the boot-cljs-repl task, we need to first require a namespace from a namespace declaration to be able to require it in the bREPL as well. maybe put this note back at tutorial 5?
cool tutorial thanks!

@magomimmo
Copy link
Owner

You're right! I forgot to write that note on the tutorial-05 as well. I just fixed it.
https://github.com/magomimmo/modern-cljs/blob/master/doc/second-edition/tutorial-05.md#brepling-with-the-login-form

Thanks so much for the help!

@magomimmo
Copy link
Owner

@hlolli Sorry, I did not noted you request about emacs/cider.

also; you said in the tutorial earlier you were using emacs, as clojure user (JVM) I thought I could connect to nrepl with M-x cider-connect but this is not the case, maybe you could share some info (or link me) to where I can connect to the boot-nrepl with cider.

I use emacs/cider (0.10.0 at the moment) all the time. I create two cider connection, one for the CLJ REPL and the other for the CLJS bREPL. This way I have only one JVM running for all the stuff.

To setup emacs/cider for boot follow this documentation:

https://github.com/boot-clj/boot/wiki/Cider-REPL

@burningTyger
Copy link
Contributor

Took me like 10 minutes to figure out it has to be changed to that line. Not adding a new (ns ...) at the bottom. Will propose a change to the note in another PR.

@magomimmo
Copy link
Owner

Thanks. I'll appreciate a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants