Why is my deployed project showing a 404 error?

Learn the possible reasons a successful deployment gives a 404 error
Last updated on October 22, 2024
Build, Deployment & Git

This guide explains the possible reasons why your project may show a 404 error when you visit the URL, despite the build completing successfully and showing as deployed.

Ensure that the deployment URL you are using is correct and does not contain any typos or incorrect paths. You should also make sure that the deployment exists and has not been deleted. You can do this by checking the deployments for your project in the project dashboard.

You should also make sure you have the correct permissions to view the URL. There are different levels of deployment protection available on Vercel, please verify you have the necessary level of access and, if needed, are logged in to your Vercel account to view the deployment.

Another common reason a successfully deployed project gives a 404 is due to a misconfiguration in the build settings. Please check these out and make sure that you are using the correct options for your project and running the commands in the correct directory, you can read more about this in our documentation.

The most likely misconfiguration would be the Output Directory. If this is not correct it can mean that, even if the project builds without any errors, Vercel is serving files from a potentially empty folder, leading to your expected paths not existing. If you think this looks correct, please check out your framework configuration as well, often these provide the option to edit the Output directory so it could be different than the default. For example, Next.js provides the option to edit this in your `next.config.js` file.

For projects categorized under "Other frameworks" (which includes static HTML sites), Vercel prioritizes files in the public folder over those in the root directory. This behaviour ensures better organization and security for your static assets but can be overridden during the build step, allowing for more flexible configurations.

If the deployment exists, you should also review the build logs to identify any issues that might have caused the deployment to be unavailable or pages to be missing.

If the build logs do not indicate any issues, you should also check the runtime logs. These logs provide real-time information about the execution of your application and can help identify issues that cause the deployment not to load properly. Inspect these logs for any errors or warnings.

If you are still having issues after considering all of the above, please visit http://vercel.com/help and provide the deployment information, including the URL and link to the logs from the Vercel dashboard.

Couldn't find the guide you need?