Moralis Provider not working in nextjs13, layout.tsx #5751
-
I'm trying to use the MoralisProvider in my layout.js file, but it throws an error when I import it. Here's the error message I receive:
Here's my code in layout.js:
I would appreciate any help in resolving this error and successfully using the MoralisProvider in my layout.js file. Thank you! I tried to use the MoralisProvider in my home page and it worked, code:
but I want to use my Header components in all of my pages so i think i need a way to implement the provider in the layout file. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
if not works fine, please share your repo |
Beta Was this translation helpful? Give feedback.
-
According to NextJS 13 docs, I can do this by wrapping MoralisProvider in "use client" declaration like this ```"use client";
|
Beta Was this translation helpful? Give feedback.
According to NextJS 13 docs, I can do this by wrapping MoralisProvider in "use client" declaration like this ```"use client";
import { MoralisProvider } from "react-moralis";
export default MoralisProvider;