I'm not sure what happened, but I was trying to get my BlockContent component to work because it isn't displaying any styles (only plain text), and now I can't deploy my sanity project! It runs fine except when I try to deploy it.
I am getting this error:
Error: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.
at resolveDispatcher (C:/Users/Mail4/OneDrive/Documents/Programming/ReactJS Projects/my-portfolio/brandonsblog/node_modules/@sanity/base/node_modules/react/cjs/react.development.js:1476:13)
at useMemo (C:/Users/Mail4/OneDrive/Documents/Programming/ReactJS Projects/my-portfolio/brandonsblog/node_modules/@sanity/base/node_modules/react/cjs/react.development.js:1531:20)
at Document (C:/Users/Mail4/OneDrive/Documents/Programming/ReactJS Projects/my-portfolio/brandonsblog/node_modules/@sanity/base/lib/components/Document.js:49:40)
at processChild (C:/Users/Mail4/OneDrive/Documents/Programming/ReactJS Projects/my-portfolio/brandonsblog/node_modules/react-dom/cjs/react-dom-server.node.development.js:3353:14)
at resolve (C:/Users/Mail4/OneDrive/Documents/Programming/ReactJS Projects/my-portfolio/brandonsblog/node_modules/react-dom/cjs/react-dom-server.node.development.js:3270:5)
at ReactDOMServerRenderer.render (C:/Users/Mail4/OneDrive/Documents/Programming/ReactJS Projects/my-portfolio/brandonsblog/node_modules/react-dom/cjs/react-dom-server.node.development.js:3753:22)
at ReactDOMServerRenderer.read (C:/Users/Mail4/OneDrive/Documents/Programming/ReactJS Projects/my-portfolio/brandonsblog/node_modules/react-dom/cjs/react-dom-server.node.development.js:3690:29)
at Object.renderToStaticMarkup (C:/Users/Mail4/OneDrive/Documents/Programming/ReactJS Projects/my-portfolio/brandonsblog/node_modules/react-dom/cjs/react-dom-server.node.development.js:4314:27)
at buildStaticAssets (C:/Users/Mail4/OneDrive/Documents/Programming/ReactJS Projects/my-portfolio/brandonsblog/node_modules/@sanity/core/lib/actions/build/buildStaticAssets.js:162:118)
at async _default (C:/Users/Mail4/OneDrive/Documents/Programming/ReactJS Projects/my-portfolio/brandonsblog/node_modules/@sanity/core/lib/actions/deploy/deployAction.js:93:9)
I'm not sure what happened, but I was trying to get my BlockContent component to work because it isn't displaying any styles (only plain text), and now I can't deploy my sanity project! It runs fine except when I try to deploy it.
I am getting this error:
and here is my package.json file:
You can find my code here: https://github.com/bpyle02/portfolio And the live website here: https://brandonpyle.netlify.app/blog/how-to-properly-write-a-github-readme