NoMoralisContextProviderError Nextjs

NoMoralisContextProviderError: Make sure to only call useMoralis within a
The error is appears whenever I use " const { isAuthenticated, Moralis } = useMoralis();
"

Hi @theonrex

Did you also wrap your app code with MoralisProvider ?

The error seems related to missing MoralisProvider

Yes, I’ve done that but it still displays the error

Did you include MoralisProvider in _app file or the index file?
If possible can you show how you have used it?

Annotation 2023-02-14 100504 _app.js file

Your code seems ok. :thinking:

Can you try the solution mentioned here? Seems like a similar issue related to the package version.

Annotation 2023-02-14 103532

I’ve done that but the error is still there

Can you install the exact versions, without ^.

Yes, I’ve done it but it adds ^ it automatically

If you are using yarn use -e tag and @<version> suffix or with npm use @<version> suffix.

Refer the previously shared link for details.