import React from "react";
import ReactDOM from "react-dom";
import App from "./App";
import { MoralisProvider } from "react-moralis";
import "./index.css";
import { MoralisDappProvider } from "./providers/MoralisDappProvider/MoralisDappProvider";
/** Get your free Moralis Account https://moralis.io/ */
const APP_ID = process.env.REACT_APP_MORALIS_APPLICATION_ID;
const SERVER_URL = process.env.REACT_APP_MORALIS_SERVER_URL;
const Application = () => {
const isServerInfo = APP_ID && SERVER_URL ? true : false;
if (isServerInfo)
return (
<MoralisProvider appId={APP_ID} serverUrl={SERVER_URL}>
<MoralisDappProvider>
<App isServerInfo />
</MoralisDappProvider>
</MoralisProvider>
);
};
ReactDOM.render(
// <React.StrictMode>
<Application />,
// </React.StrictMode>,
document.getElementById("root")
);
REACT_APP_MORALIS_APPLICATION_ID =4iIHci6fwlwJ6cfphuObaEcdKCgFPkw7feYagGz7
REACT_APP_MORALIS_SERVER_URL = https://fagrndp36ogz.usemoralis.com:2053/server
sir, why am i always getting this provider not set error in all the boilerplate, is it from my end or whatโฆ this error is disturbing my brain
1 Like
Ah man, Iโve been trying to replicate this issue.
Just a quick rundown questions to evaluate -
- Which browser are you using? Does your browser have metamask extension installed?
- Iโm assuming you did not make any changes to the code other than your .env file. Correct me if Iโm wrong.
- Your server is up and running ? Iโm assuming yes.
- Did you install all the dependencies again? By running
yarn install
?
my browser is Microsoft Edge and i have metamask install
my server is runner and i have all the dependencies installed by using yarn install
i did not change anything rather than inserting my server and app ID in the .env file
thank you sir, i just switch my browser to chrome
and it worked, even yarn web work without any provider error
Yes. Thatโs great ! Happy to help !
1 Like