Skip to content

Instantly share code, notes, and snippets.

@michaelsbradleyjr
Created May 6, 2012 00:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelsbradleyjr/2606633 to your computer and use it in GitHub Desktop.
Save michaelsbradleyjr/2606633 to your computer and use it in GitHub Desktop.
(ns hello
(:require [cljs.nodejs :as nodejs]
[foo :as foo]))
;;(def foo (.-foo (nodejs/require "./foo")))
(defn ^:export greet [n]
;;(str "Hello, " (.title foo n)))
(str "Hello, " (foo/title n)))
;; ------- foo.cljs -------
;; foo.cljs is in the same directory as hello.cljs
(ns foo)
(defn ^:export title [n]
(str "Mr. " n))
@michaelsbradleyjr
Copy link
Author

I'm getting the following error when I invoke greet as defined in hello.cljs (which has been compiled with simple optimizations):

May 5, 2012 7:52:43 PM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: hello:5: ERROR - required "foo" namespace never provided
goog.require('foo');
^

May 5, 2012 7:52:44 PM com.google.javascript.jscomp.LoggerErrorManager printSummary
WARNING: 1 error(s), 0 warning(s)
ERROR: JSC_MISSING_PROVIDE_ERROR. required "foo" namespace never provided at hello line 5 : 0
Cannot call method 'greet' of undefined

@michaelsbradleyjr
Copy link
Author

simply needed to push process.cwd() onto the classpath from the nodejs side of things...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment