taoensso / sente

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

Invalid event "~#chsk/handshake” when using packers.transit/get-transit-packer #369

Closed MawiraIke closed 1 year ago

MawiraIke commented 4 years ago

I am getting an error, "Invalid event ~#chsk/handshake" when trying to establish a connection between my server and client. My usage follows keenly the default example of this repo. The error that is output to console is

cljs$core$ExceptionInfo
  message: "Invalid event"
  data: {:given "~:chsk/handshake", :errors {:wrong-type {…}}}

The successive ws/pings fail with the same error but more information,

sente.cljc:142 Uncaught #error {:message "Invalid event", :data {:given "~#'", :errors {:wrong-type 
{…}[:expected :vector]
   [:actual {:type #object[String], :value "~#'"}]

As a result, I cannot send messages between the client and the server but get the warning,

VM207 core.js:155 WARN [taoensso.sente:846] - Chsk send against closed chsk.

and the error message same to ws/ping above. Further trials to debug have been unfruitful. Is this an error in the repo or is there something that I am missing? I am using v1.15.0

MawiraIke commented 4 years ago

After further investigation, I would like to note that I have realized the error only exists if use the packer, (packers.transit/get-transit-packer) and not :edn.

ptaoussanis commented 1 year ago

Closing as part of issue triage. Please feel free to re-open if this issue is still relevant with recent versions of Sente!