simon-brooke / youyesyet

Web-app to support canvassers in the forthcoming independence referendum in Scotland
GNU General Public License v2.0
3 stars 0 forks source link

Uberwar does not build CLJS correctly #36

Closed simon-brooke closed 7 years ago

simon-brooke commented 7 years ago

There are AT LEAST two issues here:

  1. The URL for assets isn't getting set correctly;
  2. The javascript file that's generated still tries to connect to figwheel.
simon-brooke commented 7 years ago

lein uberwar does build what appears to be a single optimised JavaScript file, target/uberjar/cljsbuild_main.js. The file is 516Kb, and I think it's probably substantially complete. Unfortunately it has bug #37, so no pages render, so I can't actually test whether it's correct.

However, relevant to this bug, it is not copied into the correct place before the war file is packaged.

simon-brooke commented 7 years ago

Right, with bug #37 done, I can now build all the components of a valid war file. But the ClojureScript is still compiled to target/uberjar/cljsbuild_main.js, and does not get deployed correctly, and has to be deployed manuually. Also, the map does not render; the error message is:

Uncaught TypeError: L.map(...).eg is not a function
    at hx (app.js:714)
    at Object.ix (app.js:715)
    at Object.componentDidMount (app.js:652)
    at e.notifyAll (app.js:36)
    at r.close (app.js:38)
    at r.closeAll (app.js:39)
    at r.perform (app.js:39)
    at o.perform (app.js:39)
    at o.perform (app.js:38)
    at Object.T [as flushBatchedUpdates] 

L.map is declared in externs.js which SHOULD be being compiled into the build, so I'm not sure what's wrong. Leaflet (both js and css) is being deployed correctly so that is not the problem.