Fork me on GitHub
#shadow-cljs
<
2018-10-31
>
Wilson Velez03:10:56

Hi all, I’m having a problem, I’m seeing this message in the chrome console

Wilson Velez03:10:02

browser.cljs:325 Uncaught DOMException: Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.
    at shadow$cljs$devtools$client$browser$heartbeat_BANG_ ()

Wilson Velez03:10:33

and my app is not reloading, any clues?

cmal06:10:21

Hi, @thheller I got a NullPointerException when shadow-cljs release qiniu compiling a node-library:

:qiniu {:target :node-library
          :output-to        "out/node-library/qiniu.js"
          :exports          {:list qiniu.core/list-prefix
                             :del qiniu.core/delete-key
                             :clear qiniu.core/delete-keys}}
[:qiniu] Compiling ...
NullPointerException:
	clojure.lang.Numbers.ops (Numbers.java:1018)
	clojure.lang.Numbers.dec (Numbers.java:120)
	shadow.build.warnings/get-source-excerpts/make-source-excerpt--10702 (warnings.clj:27)
	shadow.build.warnings/get-source-excerpts/iter--10704--10708/fn--10709/fn--10710 (warnings.clj:44)
	shadow.build.warnings/get-source-excerpts/iter--10704--10708/fn--10709 (warnings.clj:43)
	clojure.lang.LazySeq.sval (LazySeq.java:40)
	clojure.lang.LazySeq.seq (LazySeq.java:49)
	clojure.lang.RT.seq (RT.java:528)
	clojure.core/seq--5124 (core.clj:137)
	clojure.core.protocols/seq-reduce (protocols.clj:24)
	clojure.core.protocols/fn--7835 (protocols.clj:75)
	clojure.core.protocols/fn--7835 (protocols.clj:75)
	clojure.core.protocols/fn--7781/G--7776--7794 (protocols.clj:13)
	clojure.core/reduce (core.clj:6748)
	clojure.core/into (core.clj:6815)
	clojure.core/into (core.clj:6807)
	shadow.build.warnings/get-source-excerpts (warnings.clj:45)
	shadow.build.warnings/get-source-excerpts (warnings.clj:9)
	shadow.build.warnings/get-source-excerpts-for-rc (warnings.clj:51)
	shadow.build.warnings/get-source-excerpts-for-rc (warnings.clj:47)
	shadow.build/enhance-warnings (build.clj:34)
	shadow.build/enhance-warnings (build.clj:21)
	shadow.build/extract-build-info/fn--12724 (build.clj:92)
	clojure.core/map/fn--5587 (core.clj:2745)
	clojure.lang.LazySeq.sval (LazySeq.java:40)
	clojure.lang.LazySeq.seq (LazySeq.java:49)
	clojure.lang.RT.seq (RT.java:528)
	clojure.core/seq--5124 (core.clj:137)
	clojure.core.protocols/seq-reduce (protocols.clj:24)
	clojure.core.protocols/fn--7835 (protocols.clj:75)
	clojure.core.protocols/fn--7835 (protocols.clj:75)
	clojure.core.protocols/fn--7781/G--7776--7794 (protocols.clj:13)
	clojure.core/reduce (core.clj:6748)
	clojure.core/into (core.clj:6815)
	clojure.core/into (core.clj:6807)
	shadow.build/extract-build-info (build.clj:94)
	shadow.build/extract-build-info (build.clj:64)
	shadow.build/update-build-info-after-compile (build.clj:102)
	shadow.build/update-build-info-after-compile (build.clj:100)
	shadow.build/compile (build.clj:354)
	shadow.build/compile (build.clj:344)
	shadow.cljs.devtools.api/release* (api.clj:306)
	shadow.cljs.devtools.api/release* (api.clj:293)
	shadow.cljs.devtools.cli/do-build-command (cli.clj:29)
	shadow.cljs.devtools.cli/do-build-command (cli.clj:26)
	shadow.cljs.devtools.cli/do-build-commands (cli.clj:51)
	shadow.cljs.devtools.cli/do-build-commands (cli.clj:40)
	shadow.cljs.devtools.cli/main/body-fn--15607--auto----16461 (cli.clj:168)
	shadow.cljs.devtools.cli/main (cli.clj:167)
	shadow.cljs.devtools.cli/main (cli.clj:134)
	clojure.core/apply (core.clj:661)
	clojure.core/apply (core.clj:652)
	shadow.cljs.devtools.cli/-main (cli.clj:221)
	shadow.cljs.devtools.cli/-main (cli.clj:219)
	clojure.lang.Var.applyTo (Var.java:702)
	clojure.core/apply (core.clj:657)
	clojure.main/main-opt (main.clj:317)
	clojure.main/main-opt (main.clj:313)
	clojure.main/main (main.clj:424)
	clojure.main/main (main.clj:387)
	clojure.lang.Var.applyTo (Var.java:702)
	clojure.main.main (main.java:37)

cmal06:10:39

shadow-cljs - config: /Users/yuzhao/gits/mobile/cljs/shadow-cljs.edn cli version: 2.6.21 node: v8.9.4

cmal08:10:59

the into [] of extract-build-info of build.clj.

thheller09:10:18

@cmal hmm that is odd. it appears you have a warning in your code with an invalid source location. there was a similar problem with some macro generated code ages ago but that was fixed.

thheller09:10:46

@wvelezva hmm is the websocket connection getting blocked somehow? can you check the state of the websocket connection in the browser devtools?

Wilson Velez15:10:28

The devtools only show pending

thheller17:10:43

that is odd. is your local firewall maybe blocking the connection or so?

Wilson Velez19:10:30

no, it isn’t

Wilson Velez19:10:49

it is working on firefox and in a incognito mode chrome

Wilson Velez19:10:13

it is something related with my current chrome status

Wilson Velez19:10:42

I can work with an incognito window

thheller09:10:37

@cmal I just published 2.6.22 which catches those exceptions since they are not critical. would help if you could paste the remaining warnings so that I can maybe figure out why it would fail to extract the source excerpt.

Logan Powell13:10:56

Is there a way to load remote resources into a cljs project using shadow? I'm working on publishing an NPM library that has a couple of configuration files I'd like to keep out of the library and load when the user uses the library, so they don't have to update the library every time the config gets updated...

Logan Powell14:10:38

It's cool if I can't, I can just add some core.async to work it in... just curious

thheller15:10:49

@loganpowell not sure what you are asking. if your library needs to load other files that aren't part of your compilation then shadow-cljs cannot help no

Logan Powell15:10:21

Thank you sir. I figured I'd ask 😉

Logan Powell15:10:31

I'm just trying to figure out how to best load a config without having to request it over the wire every time a user of the NPM library I'm publishing calls a function that needs it

Logan Powell15:10:12

It may just be the price I have to pay for separating out the remote config

thheller15:10:25

if its part of the library you can just js/require it

thheller15:10:40

if its remote you need to request it by other means

Logan Powell15:10:59

I have it working with an internal core.async fetch

Logan Powell15:10:20

but it will be requested on every function call it pertains to

Logan Powell15:10:50

I was trying to figure out a way to load it just once

Logan Powell15:10:01

don't worry about it. It will work for an MVP. Do you ever sleep?! 😄

thheller15:10:59

not usually at 16:20 😉

🚬 4
🍁 4
Logan Powell15:10:21

I keep forgetting you're in Germany