Skip to content
This repository has been archived by the owner on Feb 26, 2020. It is now read-only.

Packaging, again... #5

Open
jacogr opened this issue Feb 14, 2019 · 4 comments
Open

Packaging, again... #5

jacogr opened this issue Feb 14, 2019 · 4 comments

Comments

@jacogr
Copy link
Contributor

jacogr commented Feb 14, 2019

... We cannot seem to win.

Works under Node, now breaks under Webpack.

Uncaught TypeError: TextDecoder is not a constructor
    at eval (schnorrkel_js.js?2cbf:179)
    at Object.../../node_modules/@parity/schnorrkel-js/schnorrkel_js.js (main.d8a8675f.js:351)
@jacogr
Copy link
Contributor Author

jacogr commented Feb 14, 2019

Hacking around it by editing schnorrkel_js manually, basically this -

// const TextDecoder = require('util').TextDecoder;

let cachedTextDecoder = new TextDecoder('utf-8');

(And then included that locally again, not using the imported package for the moment. The above assumes there is a TextDecoder polyfill in the env - which is the case for the polkadot-js utils, YMMV with others)

@jacogr
Copy link
Contributor Author

jacogr commented Feb 15, 2019

The issues will go away soon-ish - see rustwasm/wasm-pack#157 & rustwasm/wasm-pack#523

@kianenigma
Copy link
Collaborator

This happened while I guess you wanted to use it in a new env (RN maybe) I suppose? because the current hack should work fine in both node and browser. Can you include also the environment?

@kianenigma
Copy link
Collaborator

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

No branches or pull requests

2 participants