libp2p / js-peer-id

peer-id implementation in JavaScript. Deprecated; use https://github.com/libp2p/js-libp2p-peer-id instead.
https://github.com/libp2p/js-libp2p-peer-id
MIT License
81 stars 44 forks source link

TextDecoder support for node 10 #144

Closed nduchak closed 3 years ago

nduchak commented 3 years ago
/home/circleci/project/node_modules/peer-id/node_modules/multihashes/node_modules/multibase/src/util.js:3
const textDecoder = new TextDecoder()
                    ^
ReferenceError: TextDecoder is not defined
    at Object.<anonymous> (/home/circleci/project/node_modules/peer-id/node_modules/multihashes/node_modules/multibase/src/util.js:3:21)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Module.replacementCompile (/home/circleci/project/node_modules/append-transform/index.js:58:13)
    at Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Object.<anonymous> (/home/circleci/project/node_modules/append-transform/index.js:62:4)
    at Module.load (internal/modules/cjs/loader.js:653:32)

Error when using on Node v10

vasco-santos commented 3 years ago

Hello @nduchak

Thanks for reporting this. It is true that TextDecoder is only available since node11. We are working towards supporting Active LTS node versions to enable us to provide a better library with a smaller bundle. This way, we are not supporting node 10 anymore.

nduchak commented 3 years ago

Thanks for quick response. Seems its works for me for node 12 and 14