hildjj / node-cbor

Encode and decode CBOR documents, with both easy mode, streaming mode, and SAX-style evented mode.
MIT License
356 stars 73 forks source link

cbor-web dist is broken #149

Closed cheweytoo closed 3 years ago

cheweytoo commented 3 years ago

Both https://unpkg.com/cbor-web and .../cbor-web/dist/cbor.js from this repo (which are currently identical) do not work: Loading them in a web browser (tested in Firefox 90.0.2 and Edge 92.0.902.55) leads to

TypeError: r(...) is undefined
    327 ./cbor.js:2
    o ./cbor.js:2
    481 ./cbor.js:2
    o ./cbor.js:2
    830 ./cbor.js:2
    o ./cbor.js:2
    20 ./cbor.js:2
    o ./cbor.js:2
    141 ./cbor.js:2
    o ./cbor.js:2
    <anonymous> ./cbor.js:2
    <anonymous> ./cbor.js:2
    <anonymous> ./cbor.js:2
    <anonymous> ./cbor.js:2
    <anonymous> ./cbor.js:2
cbor.js:2:155165

and therefore of course also to no cbor object in the browser context.

cheweytoo commented 3 years ago

Ah, the dist file from branch node12required works.

Leaving this issue open for visibility in case someone else encounters this. Feel free to close it though.

hildjj commented 3 years ago

I'm working toward a v8.0.0 release from that branch right now. I'll leave this open until that ships.

This was likely an issue with bignumber.js support, which I've removed to a plugin for v8.0.0.

hildjj commented 3 years ago

Please retest with v8.0.0 and reopen if this isn't fixed.

cheweytoo commented 3 years ago

Just tested: It works.

Thanks a lot!