I published my site successfully after series of issues but now it shows a blank page. I honestly don’t know how to debug this and i really need help please.
First it was 404 and i fixed that with redirects and dist doesn’t work, so i used public. Now that the site is finally published I am confronted with a blank page.
This is my GitHub link to the website am trying to publish: GitHub - Emmaluga/websense
This is my blank page Netlify website: https://websense.netlify.app/
I should quickly add also that it works fine on localhost.
thank you.
@emmaluga Based on what you’ve described you have your Build settings configured incorrectly.
You say:
You cannot just “serve the public
folder” of your repository.
It’s not build output, it’s source code.
Netlify is deploying it though, since that’s what you’ve told it to do, but it obviously won’t work as a site.
To confirm you can view source on the deployed page, you’ll see it’s identical to the file in the repository.
What you need to do is ensure your Build settings are correct for your project.
Running your build command (npm run build
) locally shows:
Which explains that your build produces a build
folder (not a dist
folder as you had tried to use).
You can also see this in the repository as it seems you’ve committed build output files:
https://github.com/Emmaluga/websense/blob/main/frontend/build/index.html
So build settings wise you want something like:
Base directory = frontend
Package directory = empty field
Build command = CI= npm run build
Publish directory = build
The Build command of CI= npm run build
is to account for the fact that your build throws a warning and they are treated as errors by default, it sets CI
to false to disable that behavior so your build can throw the warning but still complete successfully.
Thank you so much for your advice. It works perfectly and also I thank you for the lesson. The build folder is what should be served not the public folder. Thanks again.