Closed lidel closed 3 years ago
@lidel this seems like the same issue as https://github.com/Gozala/web-encoding/issues/1#issuecomment-676811667 do you mind checking if the same workaround works in this context as well ?
Getting error when using it in the latest create web app with node v15.4.0. Does anyone know how to resolve this?
System: OS: Linux 5.8 Ubuntu 20.10 (Groovy Gorilla) CPU: (4) x64 Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz Binaries: Node: 15.4.0 - ~/.nvm/versions/node/v15.4.0/bin/node Yarn: 1.17.3 - /usr/bin/yarn npm: 7.0.15 - ~/.nvm/versions/node/v15.4.0/bin/npm
Getting error when using it in the latest create web app with node v15.4.0. Does anyone know how to resolve this?
System: OS: Linux 5.8 Ubuntu 20.10 (Groovy Gorilla) CPU: (4) x64 Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz Binaries: Node: 15.4.0 - ~/.nvm/versions/node/v15.4.0/bin/node Yarn: 1.17.3 - /usr/bin/yarn npm: 7.0.15 - ~/.nvm/versions/node/v15.4.0/bin/npm
hi, have you solved it?
@mandyJiai no, I was not able to solve it. It seems that the issue was caused by using the ipfs-http-client library. Instead of using that library, I switched to using ipfs-api which still worked for my use case.
@mandyJiai @dannyhchan as described in in this comment https://github.com/Gozala/web-encoding/issues/1#issuecomment-676811667 issue is caused by jest and jsdom combination and not this library. It can be fixed by updating jest.
jest
with--env=jsdom
fails withTypeError: TextDecoder is not a constructor
@Gozala did not dig into it, but I assume this is a bug: it is fair to expect people use
js-multiaddr
(which depends on web-encoding) in apps tested with jest.That's what we do in ipfs-webui – see below.
How to reproduce
Having below in
multibase/src/util.js
causes jest-based tests to fail in ipfs-webui: