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

Space SDK fails on import #70

Open
jordanlesich opened this issue Apr 17, 2021 · 1 comment
Open

Space SDK fails on import #70

jordanlesich opened this issue Apr 17, 2021 · 1 comment

Comments

@jordanlesich
Copy link

Steps to reproduce:
import {Users} from '@spacehq/sdk'

Import this into a create-react-app.

It will fail with this message:

`
uncaught TypeError: TextDecoder is not a constructor
at Object../node_modules/multibase/src/util.js (util.js:6)
at webpack_require (bootstrap:856)
at fn (bootstrap:150)
at Object../node_modules/multibase/src/base.js (base.js:3)
at webpack_require (bootstrap:856)
at fn (bootstrap:150)
at Object../node_modules/multibase/src/constants.js (constants.js:4)
at webpack_require (bootstrap:856)
at fn (bootstrap:150)
at Object../node_modules/multibase/src/index.js (index.js:7)
at webpack_require (bootstrap:856)
at fn (bootstrap:150)
at Object. (fsUtils.ts:2)
at Object../node_modules/@spacehq/storage/dist/utils/fsUtils.js (fs)

`

I tried adding 'web-encoding' to my node-modules, but it didn't make a difference.

@jsonsivar
Copy link
Member

Hi @jordanlesich - this seems to be an issue with the TextDecoder not being polyfilled in properly. Can you try with the latest version of CRA? Our engineers @ChriLnth and @gpuente tried this out with the latest version of CRA and it seems to be working.

If that doesn't work, if you can share your source we can take a look further into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants