Fork me on GitHub
#clojurescript
<
2017-09-22
>
jimmy04:09:19

hi guys, I got this error while compiling my project with

[org.clojure/clojure "1.9.0-alpha20"]
[org.clojure/clojurescript "1.9.908"]
in advanced mode.
Sep 22, 2017 11:15:36 AM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: /Users/nxqd/dev/project1/resources/public/js/production/out/cljs/core.js:3579: ERROR - Parse error. primary expression expected
case ##Inf:
      ^

Sep 22, 2017 11:15:36 AM com.google.javascript.jscomp.LoggerErrorManager println
SEVERE: /Users/nxqd/dev/project1/resources/public/js/production/out/cljs/test.js:257: ERROR - Parse error. ']' expected
return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [##NaN,##NaN], null);
^

jimmy04:09:50

is this the problem of compiler?

roman01la08:09:06

@ghopper I ran into this before. You can use ns name + var name instead of hash

roman01la08:09:26

+ that’s more readable for debugging

rovanion08:09:38

What produces the test.js file? Is that present in all cljs projects or is it made from one of my files? In my project it contains a:

return new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [##NaN,##NaN], null);
But the project seems to run fine either way.

mfikes12:09:47

@rovanion Look near the top of your test.js file and see if it starts with a comment like

// Compiled by ClojureScript 1.9.908
and if so, look for a call to goog.provide near the top to see which namespace it is associated with.

rovanion12:09:49

It is compiled by the cljs compiler and provides cljs.test. So that would be a clojurescript core library ns right?

rovanion12:09:39

The weird thing is that I don't use cljs.test in any of my source files. Time to check lein deps :tree:

noisesmith12:09:28

cljs.test comes with cljs - or do you mean you want to know which code is actually using it/

noisesmith12:09:49

because deps :tree won't show who uses it either

rovanion12:09:51

Yeah, why is it being requiered in the first place.

noisesmith12:09:19

it's part of cljs, so as far as lein is concerned everyone is using it who uses cljs

rovanion12:09:09

I'll up my version of cljs then and see if it helps.

rovanion12:09:24

Nope, still getting the same error :/

rovanion12:09:38

Am on 1.9.908.

thheller12:09:45

@rovanion 1.9.908 is not compatible with the latest clojure 1.9 versions

rovanion12:09:40

thheller: Which version should I use?

rovanion12:09:55

To run with Clojure 1.9

thheller12:09:52

alpha17 I think

bronsa12:09:35

up to alpha20 should work

bronsa12:09:03

alpha20 excluded then

rovanion12:09:16

Right, I was up on Clojure beta1.

rovanion14:09:04

Bah, I can't seem to shake this issue with ##NaN in the compiled js. Even though the repl says I'm on alpha17 and I've run lein clean and restarted figwheel about 50 times.

rnagpal15:09:54

IS there anything similar to promise.all in clojure script ?

thheller15:09:51

whats wrong with using Promise.all directly?

rnagpal15:09:46

Promise.all I guess does’t work in IE11

rauh15:09:05

@rnagpal goog.promise/all should work. Your CLJS compilation most likely already has goog.promise pulled in since it's a very common dependency.

vinai15:09:20

@rnagpal Here is a nice post on how to do promise.all with core.async: http://clojurescriptmadeeasy.com/blog/promises-with-core-async.html

tbaldridge16:09:14

In core.async this also does pretty much the same thing as Promise.all: (async/map vector chans)

jstew16:09:21

async/map avoids the typical laziness issues, I take it.

tbaldridge16:09:56

laziness issues? @jstew

jstew17:09:16

With map. Early on in my core.async adventures I made a big seq of threads and thought I could just map the results with clojure.core/map. It was giving me unexpected results until I forced evaluation. But I was doing it all wrong anyway.

tbaldridge17:09:37

yeah, asyn/map takes and returns channels

andrea20:09:26

Does anyone have some recommendation on service workers? Is there any suggested library?