1

I would like to get a more helpful exception that this one:

Uncaught Error: Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.

I am trying to build a Reagent app without the usual minified React JavaScript library. This is where I have got so far with the project.clj file:

(defproject cljsbin "0.1.0-SNAPSHOT"
  :dependencies [
                 [org.clojure/clojure "1.7.0"]
                 [compojure "1.1.8"]
                 [hiccup "1.0.5"]
                 [ring "1.3.0"]
                 [ring/ring-json "0.3.1"]
                 [org.clojure/clojurescript "1.7.48"]
                 [me.raynes/fs "1.4.6"]
                 [reagent "0.5.1-rc3"]
                 ;[re-com "0.6.1"]
                 ]
  :cljsbuild { :builds [ :optimizations :none]}                              
  :main ^:skip-aot core)

So far I have put the important (is it?) :optimizations :none in a few places in the lein project file, but always the minified React library is included.

Later... Well I'm now quite sure I should be looking at the artifacts. What :optimizations means is covered here: https://github.com/clojure/clojurescript/wiki/Quick-Start: having optmizations gets rid of the 'goog' is undefined error messages.

So I am now using this:

;[reagent "0.5.1-rc3"]
[reagent "0.5.1-rc3" :exclusions [cljsjs/react]]
[cljsjs/react-with-addons "0.13.3-0"] 

, which is important because it shows (definitively) that the reagent library includes the react library, and that this react library can be modified. Now just to find out how to get the non-minified version and I'll be able to answer my own question...

Chris Murphy
  • 6,411
  • 1
  • 24
  • 42

1 Answers1

0

Are you sure that once you use the add-ons version, your not already getting the mimified version? I ask as the docs on the cljs/package site say

The externs file includes definitions for TestUtils but to use those with :advanced optimizations you'll need to override :file-min to use non-minified version:

which would indicate that perhaps this uses the non-mimified version unless you use :advanced compilation flag? Perhaps check the externs file and see what it has?

The other solution might be to adopt the approach on the reagent page for using your own build of reagent. To do this, I'm assuming you have to provide a bare bones cljs/react file and add the react js directly into your page?

Tim X
  • 4,158
  • 1
  • 20
  • 26
  • Yes I would think that `[cljsjs/react-with-addons "0.13.3-0"]` is giving me the minified version. I would be nice to know what to replace it with to get the non-minified version. How/where to override :file-min?? I don't know what the `externs file` is either. Links for my discovery please! :) – Chris Murphy Oct 23 '15 at 06:20
  • @ChrisMurphy We are facing the same issue. Did you find a way to use the non minified version? – Asher Dec 16 '15 at 09:11
  • I gave up in the end as this was very much 'hobby' orientated, and I'm just not a Javascript person. But they would be sure to help you in the Clojurescript Slack group. – Chris Murphy Dec 16 '15 at 09:27
  • @Asher Would you be able to provide a link from here to the question you asked? – Chris Murphy Dec 27 '15 at 02:00
  • I asked a similar question: http://stackoverflow.com/questions/34311178/using-non-minifed-clojuerscript-library-in-advanced-compilation-mode. Unfortunately, no response. – Asher Dec 27 '15 at 07:06