0

I'm building an app in React Native and Expo Go that requires Web3 user authentication. I'm using the web3-token library (https://www.npmjs.com/package/web3-token) to generate a token on the client and then verifying this token on the backend.

For some reason on build I'm getting this error:

TypeError: undefined is not an object (evaluating 'window.document.currentScript')

Here is the code in question:

import * as Web3Token from 'web3-token';

token = await Web3Token.sign(
        (msg) => web3.eth.personal.sign(msg, userAddress),
        {
          domain: 'example.com',
          statement: 'example statement',
          expires_in: '1 day',
        }
);

Does my problem have to do with the fact that I'm using a third-party library that isn't supported by the Expo SDK? Or is it possibly another issue?

TylerH
  • 20,799
  • 66
  • 75
  • 101
mobiman
  • 619
  • 1
  • 11
  • 26

0 Answers0