rustwasm / wasm-pack

📦✨ your favorite rust -> wasm workflow tool!
https://rustwasm.github.io/wasm-pack/
Apache License 2.0
6.23k stars 406 forks source link

React Native / NodeJs TextDecoder #807

Open mvniekerk opened 4 years ago

mvniekerk commented 4 years ago

🐛 Bug description

React Native does not have the NodeJs "util" module, thus can't get to the TextDecoder class. Whenever the main js file is loaded, Metro server stops because it does not have the "util" class. Installing "util" causes a cascading import of other (not-provided-for) NodeJs libs.

Possible workaround

Best is to install the "text-encoding' module. In the main .js file change it to require from "text-encoding" instead of "util" as "text-encoding" provides the TextDecoder class.

🤔 Expected Behavior

To load the TextDecoder class on React Native

👟 Steps to reproduce

🌍 Your environment

wasm-pack version: 0.9.1 rustc version: 1.42-beta.2

waleedshkt commented 3 years ago

Still no TextDecoder/ TextEncoder classes inherently included in RN.

Yeah, installing 3rd-party modules is apparently the best solution to overcome these issues

ddtch commented 1 year ago

Still the same, why it's so? Addition libraries not working as expected (