We're updating the issue view to help you get more done. 

Initial require fails to fully load added symbols

Description

In the Quick Start, a portion runs the user through adding a symbol (a function named foo) and then requiring the namespace and using that symbol. I'm finding that require fails and that I need to add the :reload directive.

To reproduce:

  1. Run through the Quick Start up through the browser REPL section.

  2. Set src/hello_world/core.cljs so that it does not have the foo function defined.

  3. Remove the out directory: rm -rf out

  4. Start up the REPL: rlwrap java -cp cljs.jar:src clojure.main repl.clj

  5. Connect Safari by going to http://localhost:9000

  6. Show the error console in Safari. (You'll see Hello world.)

  7. Run tail -f out/watch.log

  8. Add the foo function that adds a b to src/hello_world/core.cljs and save it.

  9. Observe that watch.log reflects recompilation

  10. Do {{ (require '[hello-world.core :as hello]) }}

  11. Do {{ (hello/foo 2 3) }}

At this point you will get:
TypeError: undefined is not an object (evaluating 'hello_world.core.foo.call')

But:

1 2 3 4 5 6 ClojureScript:cljs.user> (ns-interns 'hello-world.core) {foo #'hello-world.core/foo, conn #'hello-world.core/conn} ClojureScript:cljs.user> (source hello/foo) (defn foo [a b] (+ a b)) nil

Now, if you :reload

1 2 3 4 ClojureScript:cljs.user> (require '[hello-world.core :as hello] :reload) nil ClojureScript:cljs.user> (hello/foo 2 3) 5

Environment

Quick Start Browser REPL (OS X / Safari)

Status

Assignee

Unassigned

Reporter

Mike Fikes

Labels

None

Approval

None

Patch

None

Fix versions

Affects versions

1.7.145

Priority

Minor