This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-07-17
Channels
- # aleph (7)
- # announcements (1)
- # aws (12)
- # beginners (118)
- # calva (15)
- # cider (17)
- # clj-kondo (1)
- # cljdoc (11)
- # cljsrn (1)
- # clojure (108)
- # clojure-dev (32)
- # clojure-europe (3)
- # clojure-italy (4)
- # clojure-kc (1)
- # clojure-nl (4)
- # clojure-portugal (1)
- # clojure-spec (29)
- # clojure-uk (69)
- # clojurescript (91)
- # cursive (14)
- # datomic (8)
- # emacs (13)
- # figwheel-main (12)
- # graphql (4)
- # jackdaw (1)
- # jobs (14)
- # lambdaisland (3)
- # luminus (3)
- # nyc (1)
- # off-topic (14)
- # onyx (23)
- # pedestal (8)
- # re-frame (4)
- # reitit (3)
- # shadow-cljs (6)
- # spacemacs (7)
- # specter (2)
- # tools-deps (3)
- # unrepl (4)
- # vim (7)
- # xtdb (10)
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 https://youtu.be/nn_5NVgCps4?list=PLpr9V-R8ZxiDjyU7cQYWOEFBDR1t7t0wv
@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
https://github.com/StankovicMarko/routes here is the repo if u can spot any issues
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 https://clojurians.slack.com/archives/CALJ3BFLP/p1563344996083800 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 successSorry, 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 https://github.com/cljsjs/packages/tree/master/semantic-ui-react
I think i am missing something extern or foreign lib or something in order to make it work