0
Error occurred prerendering page "/actions/user". Read more: https://nextjs.org/docs/messages/prerender-error
Error: Minified React error #31; visit https://reactjs.org/docs/error-decoder.html?invariant=31&args[]=object%20with%20keys%20%7Bdata%2C%20error%2C%20loading%2C%20mutate%2C%20isValidating%7D for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
   
    at a.b.read (D:\Portfolio\portfolio\portfolioapp\node_modules\react-dom\cjs\react-dom-server.node.production.min.js:41:83)
    at Object.exports.renderToString (D:\Portfolio\portfolio\portfolioapp\node_modules\react-dom\cjs\react-dom-server.node.production.min.js:52:138)       
    at Object.renderPage (D:\Portfolio\portfolio\portfolioapp\node_modules\next\dist\server\render.js:751:45)
    at Object.defaultGetInitialProps (D:\Portfolio\portfolio\portfolioapp\node_modules\next\dist\server\render.js:389:51)
    at Function.getInitialProps (D:\Portfolio\portfolio\portfolioapp\.next\server\pages\_document.js:502:20)
    at Object.loadGetInitialProps (D:\Portfolio\portfolio\portfolioapp\node_modules\next\dist\shared\lib\utils.js:69:29)

I am trying to build project and triigered npm run build command for generating production app build but seems like thier is issue with prerendering of some the pages

enter image description here

Lexpj
  • 921
  • 2
  • 6
  • 15
  • If you can just post the code from `/actions/user` then I will be able to find the root cause, but seems like an issue with pre-render functions. – Mahesh More Dec 17 '22 at 15:20
  • Yes sure, Thanks @MaheshMore,PFA `` import useSWR from 'swr'; import fetcher from '../actions/index'; const useGetUser=()=>{ const {data,error,...rest}=useSWR('/api/v1/user',fetcher); return {data,error,loading:!data && !error,...rest}; } export default useGetUser; –  Jan 01 '23 at 13:28

0 Answers0