Fork me on GitHub

1- Is possible use javascript-modules with export default? 2- Should I import or in case of src/js/foo/index.js with "export default"? 3- When I run the example from , on the repl says WARNING: JavaScript file found on classpath for library js.hello, but does not contain a corresponding goog.provide declaration: file:/home/souenzzo/top-secret-project/src/js/hello.js It's excepteced?


Hi, I am trying to use reader literals with the latest figwheel, Template. The data_readers.clj file contains

{dbz/l debuz.utils/cmlog}
but when I
(:require [debuz.utils])
in the name space decleration I get
^--- Attempting to call unbound fn: #'debuz.utils/cmlog i 
implying that the cmlog function is not binded. What am i doing wrong ?

Ivan Fedorov19:12:36

Good day channel! I'm trying to get into clojurescript and reagent, but stuck with Uncaught ReferenceError: react_dom is not defined. Non-reagent clojurescript works fine. All of it regardless if figwheel is turned on or off. So what can I read to understand the cause?


@ognivo Try using a stable release of reagent instead of an alpha. I believe the alpha requires some npm-deps im the compiler options:

Ivan Fedorov21:12:17

ok, now its base.js:639 goog.require could not find: create_react_class

Ivan Fedorov22:12:17

I even see ReactDOM in globals


What's in your :npm-deps? Are you able to share your complete project on github or something?


I don't see a project.clj file(?)

Ivan Fedorov00:12:04

oh well, fixed now

Ivan Fedorov01:12:57

for a reason I don't know yet similar configuration lein new reagent produces single module, whilst mine inferred from lein new chestnut produces a set of modules. With :optimizations :advanced it becomes a single module, but the error seems to persist, just with mangled names.


fixed? are you still getting "could not find: create_react_class", I think you might need to npm install [email protected]

Ivan Fedorov08:12:15

Fixed on 0.8.0-alpha2. So the fixed error is `Uncaught TypeError: Cannot read property 'render' of undefined at reagent$dom$render_comp (calendrie.js:63913)`. Fixed by deleting node_modules dir. Jee, that was a bit obscure that compilation depends on it at all.


@hee-foo Not sure, but I think you need to quote it: {dbz/l #'debuz.utils/cmlog}. A fuller example would help give me more context to your problem.


@au-phiware Quoting doesnt work. Here is the full debuz.utils

( ns debuz.utils
   [clojure.string :as str]
   [goog.dom :as dom]
   [goog.dom.dataset :as domdata]))

(defn- cmessage [f]
  (fn [& args]
    (if js/goog.DEBUG (f args) nil)))

(def cmlog (cmessage js/console.log))


then in core.cljs :

(ns debuz.core
  (:require [debuz.utils]))


#dbz/l "This text is printed from src/debuz/core.cljs. Go ahead and edit it and see reloading in action." 



:dependencies [[org.clojure/clojure "1.9.0-beta4"]
                 [org.clojure/clojurescript "1.9.946"]
                 [org.clojure/core.async  "0.3.443"]] 


@souenzzo 1. Yes, there should be a default property after you've required it. 2. I've found this a tricky question my self, require it with whatever you would in es6, note you can pass strings to require now. 3. Yes, depending on how you've setup your project you will get this messages.


Sorry I dont get you. There should be a default property ?


what do you mean ?


Sorry didnt see to whom you where messaging


@hee-foo save yourself the trouble with data readers and just call (dbz/l ...) directly instead


@souenzzo 2. I might of mislead you (I was thinking of something else), it should depend on what you have in your foreign-libs entry.


I'm trying to use + ES6 modules. I dont need foreign-libs, right?


From the page you linked: "Notice that a :foreign-libs entry may now specify a directory for :file. In this case, the ClojureScript compiler will recursively search this directory for .js files and automatically create the :foreign-libs entries for you with the supplied options. The :provides namespace for each entry will be automatically computed from the directory structure." :)


You might be thinking of npm/node modules