Expensify / react-native-qrcode-svg

A QR Code generator for React Native based on react-native-svg and node-qrcode.
MIT License
1.07k stars 217 forks source link

Dependency Fix : Android app crushed when use version 6.1.1 #204 #213

Open Elanthingal opened 2 months ago

Elanthingal commented 2 months ago

Text Encoder from text-encoding cause Issue with "The Property 'TextEncoder' is not exist" . Fixed with the updated text-encoder library

Elanthingal commented 2 months ago

@luacmartins / @Kicu - can you please review ?

Kicu commented 2 months ago

@Elanthingal hey, thanks for contributing.

I will take a look at fast-text-encoding package and will review this PR tomorrow.

Kicu commented 2 months ago

hey @Elanthingal I have a few additional questions to better understand what this actually fixes.

We have recently added an Example app, in the /Example directory which allows us to test and develop react-native-qrcode-svg in isolation. I can see that when building this Example on version 6.3.2 (newest release) for all 3 apps: web, ios, android - they work correctly and I get no errors.

Is it possible for you to switch to using version 6.3.2? and if there are still errors there can you provide an example reproduction for errors?

I can see that text-encoding is not supported anymore (although perhaps it still works), whereas fast-text-encoding is supported, so the library is probably fine. However we shouldn't be updating a dependency without understanding what exactly it fixes and when an old version doesn't work.

For future reference

This PR: https://github.com/Expensify/react-native-qrcode-svg/pull/200 introduced this package: https://www.npmjs.com/package/text-encoding - it is archived https://www.npmjs.com/package/fast-text-encoding - this one looks active

Elanthingal commented 2 months ago

@Kicu for taking time to review.I will comeback tried with expo. it is working, but i will check how feasible it is to migrate the versions