Fork me on GitHub
#reagent
<
2018-04-30
>
dimovich13:04:21

getting goog.require could not find: create_react_class when compiling with :whitespace optimizations

dimovich13:04:36

same setup works fine for other projects

lwhorton14:04:36

are you using an externs file?

dimovich14:04:06

have the reagent dependency in deps.edn

dimovich14:04:57

I'm using cljs-web3 library, but it also doesn't seem to be using any externs

lwhorton14:04:19

a goog.require is usually a dependency loading order issue. make sure you are actually (:require [reagent.core ...] at the right place in your app. externs are worth a check, are you using cljsjs to hold a dependency on react, etc? as soon as you use anything but :optimizations :none you run into some oddities

dimovich14:04:25

I'm not using any cljsjs react libraries. I suppose reagent is already including them...

dimovich14:04:58

but will try adding them and see what happens

pesterhazy14:04:35

try to inspect which transitive dependencies are actually pulled in

pesterhazy14:04:55

clj -Stree I think

dimovich14:04:23

thanks for the tip, checking...

pesterhazy14:04:52

looks like it's there cljsjs/create-react-class 15.6.2-0

pesterhazy14:04:09

have you tried simple optimizations instead?

pesterhazy14:04:17

whitespace is sometimes wonky...

dimovich14:04:38

hmm... now getting errors like these during compilation

dimovich14:04:44

(with simple optimizations)

pesterhazy14:04:36

@dimovich in your repo, when I try clj -A:run it seems to work?

pesterhazy14:04:56

$ clj -A:run
Serving HTTP on localhost port 5000

dimovich14:04:20

yeah, but it has :whitespace optimizations enabled in cljs.edn

dimovich14:04:33

I changed it to :simple and now I get those errors

pesterhazy14:04:08

@dimovich works for me with :optimizations :simple also

dimovich14:04:19

hmm.... strange

pesterhazy14:04:41

are you on latest clj?

dimovich14:04:53

updated now to latest, removed all cache, retrying to compile

dimovich14:04:08

yeah, it's compiling ok now...

dimovich14:04:30

still got some JS erros after advanced optimizations, but those are due to renaming... so it's another thing