Fork me on GitHub

i did clojure -A:fig:min and copied the content of target/public to resource/public (which feels wrong) and i get this in browser console

 Failed to load resource: net::ERR_FILE_NOT_FOUND
07:57:09.041 dev-main.js:550 Success!
07:57:09.046 dev-main.js:98 Invariant Violation: Minified React error #130; visit  for the full message or use the non-minified dev environment for full errors and additional helpful warnings. 


with optimization none i get

dev-main.js:3 GET file:///cljs-out/dev/goog/base.js net::ERR_FILE_NOT_FOUND
(anonymous) @ dev-main.js:3
08:29:24.959 dev-main.js:4 GET file:///cljs-out/dev/goog/deps.js net::ERR_FILE_NOT_FOUND
(anonymous) @ dev-main.js:4
08:29:24.959 dev-main.js:5 GET file:///cljs-out/dev/cljs_deps.js net::ERR_FILE_NOT_FOUND
(anonymous) @ dev-main.js:5
08:29:24.961 index.html:16 ClojureScript could not load :main, did you forget to specify :asset-path?
(anonymous) @ index.html:16
08:29:24.961 index.html:16 Uncaught ReferenceError: goog is not defined
    at index.html:16
(anonymous) @ index.html:16
08:29:24.963 index.html:16 Uncaught ReferenceError: goog is not defined
    at index.html:16
(anonymous) @ index.html:16
08:29:24.963 index.html:16 Uncaught ReferenceError: goog is not defined
    at index.html:16
what am i missing?


i tried with bare template and it works so everything is packaged normally i have a feeling that semantic-ui lib i am using is breaking the compilation but why would it work on development then?


@lepistane you should only need to copy the single minified file from target, I believe its target/cljs-out/-dev-main.js by default Here is a video of how I deploy a ClojureScript and reagent project on GitHub pages


@jr0cket i narrowed it down to the dependency issue i started with clean figwheel main and deps and added semantic ui - and Invariant Violation: Minified React error #130 happened here is the repo if u can spot any issues


i tried with re-frame template and it fails in the same way


I am no expert, but I suggest trying it with a different optomisation level as it maybe causing issues. In your routes/deps.edn file, add another alias similar to line 12, except using simple compilation

:simple  {:main-opts ["-m" "figwheel.main" "-O" "simple" "-bo" "dev"]}


the development build does not do any compiler optimisation, so you could also try "none" instead of "simple" to just get a single .js file as output. This give you a bit of time to find out why a dependency doesnt like a particular level of compiler optomisation. cljsjs should provide externs for the libraries you include as dependencies, so when the are minified and the names are all shrunk, the names in the javascript library will still work.


not all javascript libraries will like going through the Google Closure compiler and unfortunately even though its a very powerful compiler, its not as common in the JavaScript world so doesnt get tested that much. Hope that makes sense...


i did - but without success i would get and also i managed to fix this using re-frame template but i needed to add

:infer-externs true 
:closure-warnings {:externs-validation :off :non-standard-jsdoc :off} 
:externs \["react/externs/react.js"\]
i tried to add those to dev.cljs.edn but i had no success


Sorry, I have no idea, I am still very new to this.


i narrowed it down to :advanced compilation with simple i needed to add few compiler options in order to make it work the package I think i am missing something extern or foreign lib or something in order to make it work