Fork me on GitHub
#clojurescript
<
2017-09-02
>
au-phiware05:09:47

Can I please have a hand with lein-cljsbuild and advanced optimisation? This little demo project (with prod profile) will happily compile but fails to run... I've also tried compiling with source maps but the source maps don't seem to be recognised by node. Any help is much appriciated! https://github.com/au-phiware/lein-new/issues/2

symfrog08:09:39

@au-phiware I took a quick look, it seems that you are missing extern definitions (https://clojurescript.org/reference/compiler-options#externs) . There are some node.js externs defined at https://github.com/dcodeIO/node.js-closure-compiler-externs , using the http.js and contrib/Express.js extern files should solve your issue. You could also consider using the recently improved node modules support instead https://clojurescript.org/news/2017-07-12-clojurescript-is-not-an-island-integrating-node-modules

au-phiware11:09:28

thanks for the pointers @symfrog, I've added :externs but I'm not sure if I've done it correctly because I'm still encountering the TypeError... I think I shall remove mount since it appears to be swallowing the stacktrace

au-phiware13:09:03

so, as it turns out I need to say (new (nodejs/require "express")) not ((nodejs/require "express")). Sorry, I'm new to cljs...

au-phiware14:09:47

this one looks like a bug in lein-cljsbuild: https://github.com/au-phiware/lein-new/issues/3

au-phiware14:09:45

err, I think it is actually a bug in org.clojure/clojurescript...

qqq19:09:06

boot is now just saying ot me: "failed compiling file :..../..../blah.cljs" and it doesn't give me any error message as to why it failed to compile

juhoteperi08:09:03

Missing error message sounds like a problem with old boot-cljs, fixed in latest releases

qqq10:09:49

@U061V0GG2 : updating boot-cljs version tifxed it; thanks!

qqq19:09:53

in clhs, how do (:require [http://goog.net]) }

qqq19:09:00

getting an error of:

qqq19:09:12

No such namespace: http://goog.net, could not locate goog/net.cljs, goog/net.cljc, or JavaScript source providing "http://goog.net" in file src/client/util/comm.cljs

hlolli19:09:46

You could try importing instead of requireing

mfikes21:09:39

@qqq Here is an example at the REPL:

cljs.user=> (import '( Ipv4Address))
nil
cljs.user=> (Ipv4Address. "127.0.0.1")
#object[Object 127.0.0.1]
cljs.user=> (.getVersion *1)
4