I'm building a dapp and when I'm trying to add the moralis provider to my code I get this error "Uncaught (in promise) ReactMoralisError: Provide a "appId" provided to ", which is odd because I already provided the appId, I would appreciate any tip on how to fix it.
my app.js contains:
import './App.css';
import { MoralisProvider } from "react-moralis";
function App() {
const moralisServerUrl = process.env.REACT_APP_MORALIS_SERVER_URL;
const moralisAppId = process.env.REACT_APP_MORALIS_APP_ID;
return (
<MoralisProvider appId={moralisAppId} serverUrl={moralisServerUrl}>
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div>
</MoralisProvider>
);
}
export default App;
and my env file contains:
REACT_APP_MORALIS_SERVER_URL=https://XXXXXX.usemoralis.com:2053/server
REACT_APP_MORALIS_APP_ID=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
and this is the error:
Uncaught (in promise) ReactMoralisError: Provide a "appId" provided to <MoralisProvider>
at new ReactMoralisError (Errors.ts:4:1)
at _useMoralisInit.ts:66:1
at step (tslib.es6.js:102:1)
at Object.next (tslib.es6.js:83:1)
at tslib.es6.js:76:1
at new Promise (<anonymous>)
at __awaiter (tslib.es6.js:72:1)
at _useMoralisInit.ts:53:1
at _useMoralisInit.ts:100:1
at commitHookEffectListMount (sort.js:9:1)