Prerendered-Error
Unanswered
Laysan Albatross posted this in #help-forum
Laysan AlbatrossOP
Guys, im new to NextJS, React and developement at all 😄
I dont get this error message:
Error occurred prerendering page "/artists/feddo". Read more: https://nextjs.org/docs/messages/prerender-error
TypeError: Cannot read properties of null (reading 'useContext')
that page is completely empty and looks like that:
export default function feddo() {
return(
<div>
<p>FEDDO</p>
</div>
)}
Im not using 'useContext' in this page, so im lost right now. I guess I should type the default export to 'null' regarding the documentation, but I have no Idea why and how. HEELP 😄
I dont get this error message:
Error occurred prerendering page "/artists/feddo". Read more: https://nextjs.org/docs/messages/prerender-error
TypeError: Cannot read properties of null (reading 'useContext')
that page is completely empty and looks like that:
export default function feddo() {
return(
<div>
<p>FEDDO</p>
</div>
)}
Im not using 'useContext' in this page, so im lost right now. I guess I should type the default export to 'null' regarding the documentation, but I have no Idea why and how. HEELP 😄
34 Replies
does going to
/artists worksLaysan AlbatrossOP
When starting it with next dev, yes. I also can go to each artist (artists/feddo for example). But when trying to build the project for production (deploying it on vercel or using next build) I get a bunch of these errors.
Can you list what 3rd party React Libraries did you use
or mention if any, Context Provider you used at the top level
Laysan AlbatrossOP
NextUI
hmmmmmmmm
is the error at build time or at run time?
Laysan AlbatrossOP
hmmm idk to be honest. When using next build, it shows up directly. When using next dev it only shows up when loading the page.
ah
does it throw error when you access
/artists?@Laysan Albatross hmmm idk to be honest. When using next build, it shows up directly. When using next dev it only shows up when loading the page.
this is because the page is rendered at request time in
dev. but page is rendered at build time in next buildLaysan AlbatrossOP
It throws errors when loading any page. so going to localhost:3000 and refreshing also gives me this error.
@alfon this is because the page is rendered at request time in `dev`. but page is rendered at build time in `next build`
Laysan AlbatrossOP
ahh good to know
so how did you use NextUI
i suppose its something to do with that
Laysan AlbatrossOP
So I guess every page is affected 😄
Should I share my git repo with you? Would be great if you could have a look
can you send the following
page.tsx at
layout.tsx at
layout.tsx at
latout.tsx at
page.tsx at
/artists/feddolayout.tsx at
/artist/feddo (if any)layout.tsx at
/artist (if any)latout.tsx at
/Laysan AlbatrossOP
I'm using NextUI just like explained in the docs, so setting up a provider page and Using the <Provider> Component at root
They all just look like this. Nothing more in it yet.
yes i mean i want to see the files
to make sure
Laysan AlbatrossOP
Laysan AlbatrossOP
but there was a time when it was working xd Than I added 100 things and ignored error messages and now I'm here..
tis a bad habit xd
Laysan AlbatrossOP
I know XD
The weird thing is that everything is working fine with next dev. But I can't deploy it to vercel as I can't build it correctly.
I see nothing out of the ordinary after checking all of your routes
Laysan AlbatrossOP
damn
I guess I'll place it in NextUI discord, if it's NextUI related.