I tried following the steps outlined in the official documentation, but I'm encountering an issue. Here is what I did:
next.config.js
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
env : {
MORALIS_ID: 'moralisId',
MORALIS_SERVER: 'moralisServer'
}
}
module.exports = nextConfig
And this is how I called it:
<MoralisProvider serverUrl={process.env.MORALIS_SERVER} appId={process.env.MORALIS_ID}>
<Component {...pageProps} />
</MoralisProvider>
However, when I use console.log, I get undefined and encounter the error:
ReactMoralisError: Provide a "appId" provided to <MoralisProvider>
It seems like Next doesn't recognize the id.
Where did I go wrong?
EDIT => Even adding it in the .env file didn't work
EDIT AGAIN => After restarting the server, it started working. Apologies for the confusion and thank you for your assistance