taoensso / sente

Realtime web comms library for Clojure/Script
https://www.taoensso.com/sente
Eclipse Public License 1.0
1.74k stars 193 forks source link

Bad package (only under advanced compilation) #306

Closed danielsz closed 7 years ago

danielsz commented 7 years ago

Hi Peter,

Weird error that creeps up under advanced compilation only.

2017-06-22_07:54:36.80789 17-06-22 07:54:36 asher DEBUG [taoensso.sente:208] - Bad package: [[:twitter-fu/api {:complete-registration? true}] #object[String 69bf1b]] (clojure.lang.ExceptionInfo: Invalid number format [69bf1b] {:type :reader-exception})

The event being sent is a map that contains a custom tag. Data readers are provided to handle it, and it works fine when compiling cljs with no optimizations.

Under advanced compilation, I most often see this message (but not always).

The code for the serializer is here. The data reader is here.

I'm stumped. Any idea how to debug this? Thank you!

danielcompton commented 7 years ago

What is the data that is actually being sent? I would try by removing Sente from the equation and just use the serialiser Sente is using to see if this continues?

danielsz commented 7 years ago

That is good advice. To be honest, I think it's unlikely sente has anything to do with it. I'll prepare a repo with a minimal scenario if need be. Thank you!

danielsz commented 7 years ago

Turned out to be the output-wrapper compiler option not being set to true. This is a landmine, and we'll try to change the default in our build tools.

Sorry for the noise.

https://github.com/boot-clj/boot-cljs/wiki/Troubleshooting https://github.com/boot-clj/boot-cljs/issues/64