Issue with advanced optimisation

51 views
Skip to first unread message

Arnaud Bailly

unread,
Nov 14, 2014, 11:04:55 AM11/14/14
to clojur...@googlegroups.com
Hello,
I am developing an Om/ClojureScript application and when trying to convert my code to advanced optimisations, I ran into an error: Uncaught TypeError: Cannot read property 'c' of undefined

This is certainly a problem in my settings but I am pretty much clueless. Here is my project.clj:

(defproject capital-match-ui "0.1.0-SNAPSHOT"
:description "FIXME: write this!"
:url "http://example.com/FIXME"

:dependencies [[org.clojure/clojure "1.6.0"]
[org.clojure/clojurescript "0.0-2311"]
[org.clojure/core.async "0.1.267.0-0d7780-alpha"]
[om "0.7.1"]
[com.cemerick/clojurescript.test "0.3.1"]
[prismatic/dommy "0.1.3"]]

:plugins [[lein-cljsbuild "1.0.4-SNAPSHOT"]
[com.cemerick/clojurescript.test "0.3.1"]
;; compress CSS files
[lein-aggravate "0.1.0-SNAPSHOT"]]

:source-paths ["src" "test"]

:aggravate-dirs [
{:input ["css"]
:output "out/main.css"
:suffix "css"
:compressor "yui"}
]

:cljsbuild
{
:builds
[
{:id "cmui-test"
:source-paths ["lib" "test"]
:compiler {:output-to "out/cmui-test.js"
:optimizations :simple
:pretty-print true}}

{:id "cmui-dev"
:source-paths ["lib" "main"]
:compiler {:output-to "out/cmui-main.js"
:output-dir "out"
:optimizations :none
:pretty-print true}}

{:id "cmui-user"
:source-paths ["lib" "main/capital_match/user"]
:compiler {:output-to "out/user.js"
:optimizations :advanced
:preamble ["react/react.min.js"]
:externs ["react/externs/react.js"]
:pretty-print false}}
]

:test-commands {"unit-tests" ["phantomjs"
;; adapted from base runner to load a skeleton page containig some divs for
;; Om components testing
"js/runner.js"
;; see https://github.com/swannodette/om/wiki/Testing
"js/polyfill.js"
"js/react.js"
"out/cmui-test.js"]}
})


Help greatly appreciated of course.

Thanks
Arnaud

Asim Jalis

unread,
Nov 14, 2014, 11:13:54 AM11/14/14
to clojur...@googlegroups.com
Are you getting the error in the REPL or when you run your program normally like a user would? If it is the REPL, then this is likely to be because the REPL does not work with :advanced—as I found out recently.

Arnaud

--
Note that posts from new members are moderated - please be patient with your first post.
---
You received this message because you are subscribed to the Google Groups "ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojurescrip...@googlegroups.com.
To post to this group, send email to clojur...@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.

Arnaud Bailly

unread,
Nov 14, 2014, 11:14:57 AM11/14/14
to clojur...@googlegroups.com
Thanks for your answer. No, it’s an error appearing in the browser’s console, and then of course application is not loaded.

You received this message because you are subscribed to a topic in the Google Groups "ClojureScript" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojurescript/k5GFZtH4vTI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojurescrip...@googlegroups.com.
signature.asc

Herwig Hochleitner

unread,
Nov 14, 2014, 11:31:48 AM11/14/14
to clojurescript
This sounds like it could be a missing extern. Compiling with :pseudo-names true (and :pretty-print true) might help a great deal in pinpointing it.

Arnaud Bailly

unread,
Nov 14, 2014, 7:16:04 PM11/14/14
to clojur...@googlegroups.com
Hello,
I appears to an issue with conflicting versions of clojurescript and core.async. Thanks to Hiram Madelaine, I was able to make it work using:

  [org.clojure/clojurescript "0.0-2371"]
  [org.clojure/core.async "0.1.346.0-17112a-alpha"]

Thanks
Arnaud
signature.asc
Reply all
Reply to author
Forward
0 new messages