Next.js Page blank
Answered
Pavement ant posted this in #help-forum
Pavement antOP
My page is black, no console errors or syntax errors, I'm extremely confused and would greatly appreciate if someone could help!
Answered by <Milind ツ />
Because of the addUserForm function(). You have wrote up all the state and jsx code inside it but didn't call the function in the end.
Hence, no UI on browser
Either remove the function or call the function in the end.
(Better to remove it cuz it's redundant)
Hence, no UI on browser
Either remove the function or call the function in the end.
(Better to remove it cuz it's redundant)
11 Replies
@Pavement ant My page is black, no console errors or syntax errors, I'm extremely confused and would greatly appreciate if someone could help!
Pavement antOP
The code is too big to send, Would sending a codeshare.io link be fine?
To add more context:
I'm trying to create a form which uses MariaDB, In the page im trying to use the api/add-user endpoint to insert data into MariaDB, However the page is just blank and wont display anything, theres no errors in the code, and theres no console errors in inspect element either
https://codeshare.io/w9d7lP
To add more context:
I'm trying to create a form which uses MariaDB, In the page im trying to use the api/add-user endpoint to insert data into MariaDB, However the page is just blank and wont display anything, theres no errors in the code, and theres no console errors in inspect element either
https://codeshare.io/w9d7lP
Because of the addUserForm function(). You have wrote up all the state and jsx code inside it but didn't call the function in the end.
Hence, no UI on browser
Either remove the function or call the function in the end.
(Better to remove it cuz it's redundant)
Hence, no UI on browser
Either remove the function or call the function in the end.
(Better to remove it cuz it's redundant)
Answer
I haven’t read the code (can’t load on mobile)
But a blank page on vercel while working locally
Might mean that your project on vercel doesn’t have a framework option set
Under project settings in vercel
Go to the general section
Then build and development settings
And confirm that the framework preset is Nextjs
@Pavement ant ^
@<Milind ツ /> Because of the addUserForm function(). You have wrote up all the state and jsx code inside it but didn't call the function in the end.
Hence, no UI on browser
Either remove the function or call the function in the end.
(Better to remove it cuz it's redundant)
Pavement antOP
Yeah cant believe I missed that, now works thanks