Fork me on GitHub

I've typed a sdfçlj asdlfkj asd on my cljs file, and It appeared as a Warning. Is that right ? I didnt see an Error yet, just Warning .


Use of undeclared Var guts.http/asdlfkj


Every non sensical word became Use of undeclared Var as a Warning


@troglotit if you mean webpack loaders like image loaders and css loaders, the answer is no, shadow doesn’t do that for you


is there a way to run a node js script via shadow-cljs? My workflow for a thing is, I compile a node script, then run it via node ..., and I’m looking for a cleaner way to do things.


@thheller try to write a target for react native, met this error.

JS runtime connected.
[2018-04-07 19:16:05 - ERROR] UT005071: Undertow request failed HttpServerExchange{ POST /worker/files/app/467f79fb-e0e5-4f7b-9df5-56e803f4cf44/1998cbc0-21d4-4a18-a69f-aa7b9dff54f0 request {Connection=[keep-alive], Accept=[*/*], Accept-Language=[en-us], Accept-Encoding=[gzip, deflate], Content-Type=[application/edn; charset=utf-8], Content-Length=[303], User-Agent=[HelloRN/1 CFNetwork/893.14 Darwin/16.7.0], Host=[]} response {}}
clojure.lang.ExceptionInfo: no output for id: [ "clojure/walk.cljs"] {:resource-id [ "clojure/walk.cljs"]}
	at clojure.core$ex_info.invokeStatic(core.clj:4739)
	at clojure.core$ex_info.invoke(core.clj:4739)
	at $files_req$fn__19941.invoke(ws.clj:221)
	at clojure.core$map$fn__5587.invoke(core.clj:2745)
	at clojure.lang.LazySeq.sval(
	at clojure.lang.LazySeq.seq(
	at clojure.lang.RT.seq(
	at clojure.core$seq__5124.invokeStatic(core.clj:137)
	at clojure.core.protocols$seq_reduce.invokeStatic(protocols.clj:24)
	at clojure.core.protocols$fn__7835.invokeStatic(protocols.clj:75)
	at clojure.core.protocols$fn__7835.invoke(protocols.clj:75)
	at clojure.core.protocols$fn__7781$G__7776__7794.invoke(protocols.clj:13)
	at clojure.core$reduce.invokeStatic(core.clj:6748)
	at clojure.core$into.invokeStatic(core.clj:6815)
	at clojure.core$into.invoke(core.clj:6807)
	at $files_req.invokeStatic(ws.clj:245)
	at $files_req.invoke(ws.clj:173)
	at $process_req.invokeStatic(ws.clj:283)
	at $process_req.invoke(ws.clj:253)
	at clojure.lang.AFn.applyToHelper(
	at clojure.lang.AFn.applyTo(
	at clojure.core$apply.invokeStatic(core.clj:659)
	at clojure.core$apply.invoke(core.clj:652)
	at shadow.http.router$call_handler.invokeStatic(router.clj:12)
	at shadow.http.router$call_handler.invoke(router.clj:11)
	at shadow.cljs.devtools.server.web$root.invokeStatic(web.clj:160)
	at shadow.cljs.devtools.server.web$root.invoke(web.clj:159)
	at shadow.cljs.devtools.server$get_ring_handler$fn__21898.invoke(server.clj:60)
	at ring.middleware.resource$wrap_resource$fn__21453.invoke(resource.clj:37)
	at ring.middleware.resource$wrap_resource$fn__21453.invoke(resource.clj:37)
	at ring.middleware.params$wrap_params$fn__19405.invoke(params.clj:67)
	at shadow.cljs.devtools.server.ring_gzip$wrap_gzip$fn__21523.invoke(ring_gzip.clj:94)
	at shadow.undertow$ring_STAR_$reify__21609.handleRequest(undertow.clj:28)
	at io.undertow.server.Connectors.executeRootHandler(
	at io.undertow.server.HttpServerExchange$
	at java.util.concurrent.ThreadPoolExecutor.runWorker(
	at java.util.concurrent.ThreadPoolExecutor$
I found the code


don't know why there's no clojure/walk in :output of state, there're clojure/string, clojure/data, etc.

Alex H15:04:29

I've just updated to shadow-cljs 2.2.25, and stuff that used to work in the JS interop stopped working; I'm requiring a js file (with ["/gen/editor" :as editor], which in turn requires some npm modules; some of those npm modules are in commonjs format, so I use a "const omit = require('ramda/src/omit') for example instead of an ES6 import, to avoid the .default

Alex H15:04:47

however, shadow-cljs (or cljs? or something?) now always seems to add .default to the uses of that

Alex H15:04:08

var omit$$module$gen$editor = module$node_modules$ramda$src$omit.default;

Alex H15:04:47

var module$node_modules$ramda$src$omit = shadow.js.require("module$node_modules$ramda$src$omit", {});

Alex H15:04:52

(in reverse order, sorry)

Alex H15:04:06

is there a way to avoid that automatic appending of .default to anything imported in JS?

Alex H15:04:15

it used to work on 2.0.138 as far as I can tell

Alex H16:04:10

this is what is in the cljs-runtime/module$node_modules$ramda$src$omit.js file: shadow$provide.module$node_modules$ramda$src$omit=function(e,k,a,p,f){e=a("module$node_modules$ramda$src$internal$_curry2")(function(a,e){for(var c={},f={},g=0,k=a.length;g<k;)f[a[g]]=1,g+=1;for(var p in e)f.hasOwnProperty(p)||(c[p]=e[p]);return c});p.exports=e}

Alex H16:04:11

somehow trying to revert to 2.0.138 causes all sorts of other weird issues now. great.

Alex H16:04:15

@thheller, any idea of how to work around that?

Alex H17:04:13

ok, interesting - they just broke compatibility with everything in closure compiler itself

Alex H17:04:26

doing import * as omit from 'ramda/src/omit' for example seems to work

Alex H17:04:56

on a slightly unrelated note, though, with the latest shadow-cljs I keep running into issues where it can't reload the js namespaces properly, though

Alex H17:04:02

when they get modified

Alex H17:04:10

in that reproducer repo (after fixing the import), I get:

Alex H17:04:18

[:app] Build failure: no source by provide: module$gen$abc {:provide module$gen$abc} ExceptionInfo: no source by provide: module$gen$abc

👍 4

hello, I’m trying to follow this guide and it’s unclear to me what I need to do after I run shadow-cljs watch app


the article seems to imply that my browser should load something


is that automatic or do I have to point it somewhere?


I don’t think shadow will open a browser. Which guide are you referring to?


I changed the sentences a bit. Try if that helps.


for short, you can tell shadow-cljs to start an HTTP server.


thanks, reading


It has an explicit config key to open a dev server in the shadow edn config.


this guide is much more complete, many thanks


Note that there is an official user manual that for some reason doesn’t appear very high on Google:


@orestis I did see that, but I think it’s better suited as a reference rather than a guide to a newcomer!


I found myself jumping around in that manual, struggling to form a complete picture


so another question: is figwheel still superior in terms of reloading?


Yeah, the manual is a reference. I think a quick start guide would be helpful there.


No idea about superiority, but it is claimed that shadow provides the necessary functionality.


I lurk in this channel and I’m just repeating what I read :)


good strategy 😄


@alex340 the JS on the classpath stuff currenly only works with ES6. Closure processes CommonJS strangely and I don't know how to deal with that yet.