Getting “404 could not be found” for a Netlify page

Hi guys,

I’m using Netlify. When I attempt to deploy my site on netlify (or any hosting service for that matter), I am met with a “Page not found” and an error in the console which reads: "Failed to load resource: the server responded with a status of 404 (). "

Here is my Github link: [GitHub - GitHub - Idj-copy/Notifsport
Here is the Netlify link: https://phenomenal-pie-f7dad5.netlify.app/

I’m fairly new to web development and never deployed a page before. I did spend a few hours looking online first before coming here but just can’t figure it out. Oh, and everything works locally.

I’d recommend taking a look at this support guide as a first pass at troubleshooting:

@Idj-copy My guess is that you haven’t set your Build configuration
https://docs.netlify.com/configure-builds/overview/

Netlify don’t set it automatically, you need to set values that match your project requirements.

Checking your repository, all of your files are in a folder of project:

Without the correct Build configuration, it’s just deploying all your source files, as evidenced by:

https://phenomenal-pie-f7dad5.netlify.app/project/package.json
https://phenomenal-pie-f7dad5.netlify.app/project/vite.config.ts
https://phenomenal-pie-f7dad5.netlify.app/project/src/hooks/useEvents.ts
etc

In your case you probably want something like:

Base directory = project
Project directory = (leave as blank / default)
Build command = npm run build
Publish directory = dist

If you find the build fails due to it throwing warnings, use CI= npm run build as the Build command.


You’ve also got your dist folder committed to your repository:

You should remove it and add it to a .gitignore file.

Okay, I’ve followed your procedure and I’ve had several errors in my code. I’ll try to fix these errors and restart my deployment. Thanks a lot for your help

1 Like