Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CBOR transport serializer: make it work in browser builds #466

Closed
oberstet opened this issue Sep 11, 2019 · 2 comments
Closed

CBOR transport serializer: make it work in browser builds #466

oberstet opened this issue Sep 11, 2019 · 2 comments

Comments

@oberstet
Copy link
Contributor

currently, cbor transport serialization does not work in the browser build, and in fact we deactivate the dependency for the browser build in package.json:

  "browser": {
    "cbor": false,
    "ws": false,
    "./lib/transport/rawsocket.js": false
  },

there are 2 issues .. the first is that the google closure compiler fails:

build/autobahn.js:13709: ERROR - [JSC_CANNOT_CONVERT] This code cannot be converted from ES6. extending native class: Map
  constructor(iterable) {
  ^^^^^^^^^^^^^^^^^^^^^^^

when deactivating google closure (skipping library minimization), receiving messages then runs into:

CBOR decoding error Error: Insufficient data
    at Object.decodeFirstSync (autobahn.js:12390)
    at CBORSerializer.unserialize (autobahn.js:2967)
    at WebSocket.websocket.onmessage (autobahn.js:5031)

no clue why .. so needs investigation.

note: the cbor library itself does work (in browser), as we still use it in XBR for e2e encrypted payload serialization .. which is even more strange: why does that work, while above does not?

@oberstet
Copy link
Contributor Author

Elad has pointed me to #286 (comment), which according to OP works from browser.

We should try that .. and if it works, use it at least on browsers.

@om26er
Copy link
Contributor

om26er commented Oct 27, 2022

This works now with the latest release 22.10.1

@om26er om26er closed this as completed Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants