Ethereum React Native Boilerplate Questions

Hi, This question is not suitable for this page? Ethereum React Native Boilerplate Questions

Hi, I’m still waiting for reply.
Thanks.

hey, working on a react-native project. I start off with standard email password authentication then I want to link etherium accounts after doing wallet authentication like this

Moralis.onAccountsChanged( async (accounts) => {
  console.log("accounts changed")
  await Moralis.link(accounts[0]);
});

const wallet_connect = () => {
      authenticate({ connector })
      .then(() => {
        if (authError) {
          setErrortext(authError.message);
          setVisible(true);
        }
      })
      .catch(() => {});
    }

When I call the wallet_connect method the account gets created but the Moralis.onAccountsChanged method doesn’t seem to be getting called. Any thoughts on how to use onAccountsChanged properly in react native?

this may not be something that works with wallet connect

I’m trying to import my App ID and Server URL from my .env file but I keep getting this error and I’m not sure why:

Module ‘"@env"’ has no exported member ‘REACT_APP_MORALIS_APPLICATION_ID’.ts(2305)

Can anyone help me fix this?

You can add these two lines to index.d.ts

declare module '@env' {
   export const HARDHAT_PORT: string;
   export const HARDHAT_PRIVATE_KEY: string;
   export const REACT_APP_MORALIS_APPLICATION_ID: string;
   export const REACT_APP_MORALIS_SERVER_URL: string;
}

Hey @malik not sure if this is helpful but I was able to run WalletConnect and authenticate with expo via the Expo Go this is a bare bone example on how to do it, https://github.com/clxyder/walletconnect-expo-example. Hopefully this helps keep expo in the Moralis boilerplate.

1 Like

ive been getting the same thing in the non react boiler plate the last few days as well. cant figure it out

Thanks I’ll try that

1 Like

Hello @apost crypto is now available in node. If you are trying to install all dependencies from this boilerplate to your new react-native project, you should include crypto and other modules that could not be found under post-install in your package.json. I’m currently creating a CLI version of this boilerplate and I managed to fix most issues including this one that you encountered. If you find it interesting, you can check it here:

It’s still unofficial but we will publish it once we confirm this to be working on most dev environments and will delete this one in my repo.

1 Like

Hello :slight_smile:

I’m working on the React Native Boilerplate on ‘web’ and got this error :

Do you have a solution ?

Thank you for your response :slight_smile:

Hassan.

Update react-native-web to latest version

Hey guys,

I am creating users in my app using email/password sign up and login. I get a warning saying Non ethereum enabled browser. Then when I try and link a wallet to this user using something like

Moralis.Web3.link('MyWalletAddress');

I get the following error:

Possible Unhandled Promise Rejection (id: 0):
Error: Non ethereum enabled browser

And this doesn’t update the users accounts field in my user DB as would be the desired result from linking. Any help would be greatly appreciated. Cheers

@cwong Thanks, It is very helpful since I am trying to use expo with moralis lib. Everything is working fine when I only use “wallet-connect”. But it turns our error when I try to bring moralis lib in.
following error occurs when I only import the MoralisProvider setting credential and wrap it in side the walletconnectprovider.

import React from "react";
import AsyncStorage from "@react-native-async-storage/async-storage";
import WalletConnectProvider, { WalletConnectProviderProps } from "@walletconnect/react-native-dapp";
import { Platform} from "react-native";
import { expo } from "./app.json";
const { scheme } = expo;
import App from "./App";

import { MoralisProvider } from "react-moralis"

const walletConnectOptions: WalletConnectProviderProps = {
    redirectUrl: Platform.OS === "web" ? window.location.origin : `${scheme}://`,
    storageOptions: {
        // @ts-ignore
        asyncStorage: AsyncStorage,
    },
    qrcodeModalOptions: {
        mobileLinks: [
            "rainbow",
            "metamask",
            "argent",
            "trust",
            "imtoken",
            "pillar",
        ],
    },
  // Uncomment to show a QR-code to connect a wallet
  // renderQrcodeModal: Qrcode,
};

export const AppProviders = ({ children }: any) => {
    return (
        
        <WalletConnectProvider {...walletConnectOptions}>
            <MoralisProvider
            appId="my appid"
            serverUrl="my server url">
            <App/>
            </MoralisProvider>
        </WalletConnectProvider>
        
    );
};

Error below:

The provided value 'ms-stream' is not a valid 'responseType'.
at node_modules/react-native/Libraries/Network/XMLHttpRequest.js:189:6 in set__responseType
at node_modules/stream-http/lib/capability.js:36:5 in checkTypeSupport
at node_modules/stream-http/lib/capability.js:48:53 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/stream-http/lib/request.js:1:24 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/stream-http/index.js:1:27 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/xhr2-cookies/dist/xml-http-request.js:21:18 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/xhr2-cookies/dist/index.js:6:16 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/web3-providers-http/lib/index.js:25:18 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/web3-core-requestmanager/lib/index.js:45:25 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/web3-core/lib/index.js:22:30 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/web3/lib/index.js:29:18 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/lib/browser/MoralisWeb3.js:55:41 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/lib/browser/ParseUser.js:51:48 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/lib/browser/ParseACL.js:25:47 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/lib/browser/decode.js:19:46 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/lib/browser/Parse.js:31:44 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/index.js:1:24 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/react-moralis/lib/index.cjs.js:7:28 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at AppProviders.tsx:9:0 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at index.js:6:0 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/metro-runtime/src/polyfills/require.js:201:44 in guardedLoadModule
- ... 2 more stack frames from framework internals

The provided value 'moz-chunked-arraybuffer' is not a valid 'responseType'.
at node_modules/react-native/Libraries/Network/XMLHttpRequest.js:189:6 in set__responseType
at node_modules/stream-http/lib/capability.js:36:5 in checkTypeSupport
at node_modules/stream-http/lib/capability.js:49:66 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/stream-http/lib/request.js:1:24 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/stream-http/index.js:1:27 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/xhr2-cookies/dist/xml-http-request.js:21:18 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/xhr2-cookies/dist/index.js:6:16 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/web3-providers-http/lib/index.js:25:18 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/web3-core-requestmanager/lib/index.js:45:25 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/web3-core/lib/index.js:22:30 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/web3/lib/index.js:29:18 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/lib/browser/MoralisWeb3.js:55:41 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/lib/browser/ParseUser.js:51:48 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/lib/browser/ParseACL.js:25:47 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/lib/browser/decode.js:19:46 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/lib/browser/Parse.js:31:44 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/index.js:1:24 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/react-moralis/lib/index.cjs.js:7:28 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at AppProviders.tsx:9:0 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at index.js:6:0 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/metro-runtime/src/polyfills/require.js:201:44 in guardedLoadModule
- ... 2 more stack frames from framework internals

TypeError: undefined is not an object (evaluating 'EventEmitter.prototype.addListener')
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException
- ... 6 more stack frames from framework internals

Invariant Violation: "main" has not been registered. This can happen if:
* Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called.
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:172:19 in handleException
at node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:6 in handleError
at node_modules/@react-native/polyfills/error-guard.js:49:36 in ErrorUtils.reportFatalError

It is appreciated if you can share the solution if you have got it resolved.

When I try to use

import Moralis from "moralis/react-native";
Moralis.setAsyncStorage(AsyncStorage)

It brings me the error:

The provided value 'ms-stream' is not a valid 'responseType'.
at node_modules/react-native/Libraries/Network/XMLHttpRequest.js:189:6 in set__responseType
at node_modules/stream-http/lib/capability.js:36:5 in checkTypeSupport
at node_modules/stream-http/lib/capability.js:48:53 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/stream-http/lib/request.js:1:24 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/stream-http/index.js:1:27 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/xhr2-cookies/dist/xml-http-request.js:21:18 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/xhr2-cookies/dist/index.js:6:16 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/web3-providers-http/lib/index.js:25:18 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/web3-core-requestmanager/lib/index.js:45:25 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/web3-core/lib/index.js:22:30 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/web3/lib/index.js:29:18 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/lib/browser/MoralisWeb3.js:55:41 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/lib/browser/ParseUser.js:51:48 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/lib/browser/ParseACL.js:25:47 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/lib/browser/decode.js:19:46 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/lib/browser/Parse.js:31:44 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/index.js:1:24 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at AppProviders.tsx:11:0 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at index.js:6:0 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/metro-runtime/src/polyfills/require.js:201:44 in guardedLoadModule
- ... 2 more stack frames from framework internals

The provided value 'moz-chunked-arraybuffer' is not a valid 'responseType'.
at node_modules/react-native/Libraries/Network/XMLHttpRequest.js:189:6 in set__responseType
at node_modules/stream-http/lib/capability.js:36:5 in checkTypeSupport
at node_modules/stream-http/lib/capability.js:49:66 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/stream-http/lib/request.js:1:24 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/stream-http/index.js:1:27 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/xhr2-cookies/dist/xml-http-request.js:21:18 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/xhr2-cookies/dist/index.js:6:16 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/web3-providers-http/lib/index.js:25:18 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/web3-core-requestmanager/lib/index.js:45:25 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/web3-core/lib/index.js:22:30 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/web3/lib/index.js:29:18 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/lib/browser/MoralisWeb3.js:55:41 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/lib/browser/ParseUser.js:51:48 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/lib/browser/ParseACL.js:25:47 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/lib/browser/decode.js:19:46 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/lib/browser/Parse.js:31:44 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/index.js:1:24 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at AppProviders.tsx:11:0 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at index.js:6:0 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/metro-runtime/src/polyfills/require.js:201:44 in guardedLoadModule
- ... 2 more stack frames from framework internals

Unhandled promise rejection, [ReferenceError: Can't find variable: localStorage]
at node_modules/core-js-pure/internals/host-report-errors.js:6:47 in module.exports
at node_modules/core-js-pure/modules/es.promise.js:158:57 in dispatchEvent
at node_modules/core-js-pure/modules/es.promise.js:171:28 in perform$argument_0
at node_modules/core-js-pure/internals/perform.js:3:38 in module.exports
at node_modules/core-js-pure/modules/es.promise.js:168:22 in call$argument_2

TypeError: undefined is not an object (evaluating 'EventEmitter.prototype.addListener')
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:172:19 in handleException
at node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:6 in handleError
at node_modules/expo-error-recovery/build/ErrorRecovery.fx.js:12:21 in ErrorUtils.setGlobalHandler$argument_0

So I try to workaround it by using normal Moralis library:

import Moralis from "moralis";
Moralis.setAsyncStorage(AsyncStorage)
Moralis.start({appId: "my app id", serverUrl: "my server url"})

But it still turns out the error:

The provided value 'ms-stream' is not a valid 'responseType'.
at node_modules/react-native/Libraries/Network/XMLHttpRequest.js:189:6 in set__responseType
at node_modules/stream-http/lib/capability.js:36:5 in checkTypeSupport
at node_modules/stream-http/lib/capability.js:48:53 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/stream-http/lib/request.js:1:24 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/stream-http/index.js:1:27 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/xhr2-cookies/dist/xml-http-request.js:21:18 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/xhr2-cookies/dist/index.js:6:16 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/web3-providers-http/lib/index.js:25:18 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/web3-core-requestmanager/lib/index.js:45:25 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/web3-core/lib/index.js:22:30 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/web3/lib/index.js:29:18 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/lib/browser/MoralisWeb3.js:55:41 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/lib/browser/ParseUser.js:51:48 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/lib/browser/ParseACL.js:25:47 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/lib/browser/decode.js:19:46 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/lib/browser/Parse.js:31:44 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/index.js:1:24 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at AppProviders.tsx:11:0 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at index.js:6:0 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/metro-runtime/src/polyfills/require.js:201:44 in guardedLoadModule
- ... 2 more stack frames from framework internals

The provided value 'moz-chunked-arraybuffer' is not a valid 'responseType'.
at node_modules/react-native/Libraries/Network/XMLHttpRequest.js:189:6 in set__responseType
at node_modules/stream-http/lib/capability.js:36:5 in checkTypeSupport
at node_modules/stream-http/lib/capability.js:49:66 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/stream-http/lib/request.js:1:24 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/stream-http/index.js:1:27 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/xhr2-cookies/dist/xml-http-request.js:21:18 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/xhr2-cookies/dist/index.js:6:16 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/web3-providers-http/lib/index.js:25:18 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/web3-core-requestmanager/lib/index.js:45:25 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/web3-core/lib/index.js:22:30 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/web3/lib/index.js:29:18 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/lib/browser/MoralisWeb3.js:55:41 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/lib/browser/ParseUser.js:51:48 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/lib/browser/ParseACL.js:25:47 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/lib/browser/decode.js:19:46 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/lib/browser/Parse.js:31:44 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/moralis/index.js:1:24 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at AppProviders.tsx:11:0 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at index.js:6:0 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:11 in loadModuleImplementation
at node_modules/metro-runtime/src/polyfills/require.js:201:44 in guardedLoadModule
- ... 2 more stack frames from framework internals

Unhandled promise rejection, [ReferenceError: Can't find variable: localStorage]
at node_modules/core-js-pure/internals/host-report-errors.js:6:47 in module.exports
at node_modules/core-js-pure/modules/es.promise.js:158:57 in dispatchEvent
at node_modules/core-js-pure/modules/es.promise.js:171:28 in perform$argument_0
at node_modules/core-js-pure/internals/perform.js:3:38 in module.exports
at node_modules/core-js-pure/modules/es.promise.js:168:22 in call$argument_2

I really want to know how the official cli boilerplate gets around that. I do not really see the difference between what I do and the way it does in the boilerplate.

The version I am using is also the same as boilerplate:

    "moralis": "0.0.99",
    "react-moralis": "0.2.7",

I’m getting something similar, I upgraded moralis to 0.0.183 and moralis-react 0.3.11. But now I get can’t find variable local storage. Even after adding:

const Moralis = require('moralis/react-native.js');
const AsyncStorage = require('react-native').AsyncStorage;
Moralis.setAsyncStorage(AsyncStorage);

Thank you for the response,
I updated it, but i still have the warning.

I resolved the problem. but now i have this error :

add .js to your import make it look like this
import Moralis from “moralis/react-native.js”;

Thanks for the replay. I actually did use

import Moralis from "moralis/react-native.js";

But no lock.