"Can’t find variable: BigInt" when decoding Covid Vaccination Pass

Hi all,

I am trying to decode and display a “Covid Vaccination Pass” with the European Digital Green Certificate (EuDGC) npm library from Scopevisio.

I added the library to the package.json and added the example code to the default app template, but then I get an error “Can’t find variable: BigInt”. (snack.expo.io v41 on Android)

How can I work around this error? I did some research, it seems BigInt was introduced to TypeScript some time ago, but I did not get any of the mentioned work-arounds to work for me.

Thanks!

Snack thinks all is good, until the code is executed on Android device:

Screenshot 2021-07-14 at 14.40.25

Sidenote: my App.js only has 48 lines.

References:

Comment: “BigInt is one of the new feature of the ECMAScript 2020, and I think react native does not support latest ECMAScript”
Use: @babel/plugin-syntax-bigint. Is that with possible with Snack?
https://github.com/facebook/react-native/issues/28492

Use: if (typeof BigInt === ‘undefined’) global.BigInt = require(‘big-integer’);
Does not seem to work when used in App.js.

Use big-integer as polifill. Just adding in package.json doesn’t help.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.