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

Using eudgc with react native (BigInt problem)? #1

Closed
bluepuma77 opened this issue Aug 3, 2021 · 5 comments
Closed

Using eudgc with react native (BigInt problem)? #1

bluepuma77 opened this issue Aug 3, 2021 · 5 comments

Comments

@bluepuma77
Copy link

I would like to use the eudgc library on mobile with React Native.

When I create a React Native app with eudgc integrated (example code: snack.expo.dev), I receive the error Can’t find variable: BigInt when the app is compiled.

How to reproduce: I usually just scan the "Run on your device" QR code on the Expo website from within the Android Expo app, then the compilation process is started.

During problem research I found a comment on react-native GitHub:

You are importing a package somewhere that requires BigInt as a dependency. For the most part ReactNative uses JavaScriptCore which may not have the support of BigInt.

And core-js states (all the way at the bottom):

ES BigInt can't be polyfilled since it requires changes in the behavior of operators, you could find more info here. You could try to use JSBI.

Is there a way to get eudgc to run with React Native?

@srutz
Copy link
Contributor

srutz commented Aug 3, 2021

Hi Bluepuma, this question has been asked before and I received feedback from Pietro from Italy that he solved that issue.

Maybe this was helpful

facebook/react-native#28492 (comment)

It seems like react-native doesn't support the newer ECMA features and BigInt happens to be one of them.
I haven't tried to use the lib with react-native but I will try and add some recipes/solutions in the README if I find any.

If you could share your findings, that would also be greatly welcomed. Thanks.

@srutz srutz closed this as completed Nov 25, 2021
@alexduca
Copy link

Someone find a solution for implementing with react-native??

@srutz
Copy link
Contributor

srutz commented Jan 25, 2022

Hi Alexduca, see above. The workaround here facebook/react-native#28492 (comment) seemed to fix the issue.
Maybe newer versions of React-Native have more recent ECMA-Script support. Eventually this would also fix the issue.

@alexduca
Copy link

Hello @srutz !
I read all the topic but i didn't understand where i have to change because i didn't have a shim.js file in my project.

@alexduca
Copy link

Someone can help me please

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

No branches or pull requests

3 participants