Blank Page / "Site not found" issue after deploying React/Vite app on Netlify

Hello Netlify Support Team,

I am experiencing a critical issue with my React/Vite application after deploying it to Netlify. When I visit the deployed site URL, I consistently see a completely blank page (or a “Site not found” message, as shown in the attached screenshot), even though the application works perfectly on my local machine.

Project Details:

  • Application Type: React.js (built with Vite)

  • Build Directory: dist

  • Vite Configuration: I have set base: './' in my vite.config.js file.

  • Redirects File: I have created a _redirects file in my public folder (which is copied to dist after build) with the following rule:

    Plain Text

    /*    /index.html   200
    
    

Steps I have already taken to troubleshoot:

  1. Confirmed the application runs correctly locally (npm run dev).

  2. Built the application (npm run build) and verified that index.html and all assets are present in the dist folder.

  3. Attempted setting base: '/' and then base: './' in vite.config.js.

  4. Added the _redirects file to the public directory.

  5. Redeployed multiple times after each change.

  6. Even tried deploying a simple test.html file within the dist folder, but this file also did not load on the deployed URL, suggesting the issue might be with the fundamental deployment setup or how Netlify handles the dist folder.

Affected URLs (please replace with your actual URLs):

Attached (please attach these files/screenshots ):

  • Screenshot of the blank page / “Site not found” message you are seeing.

  • (Optional, but recommended) Screenshot of your dist folder structure after running npm run build.

Could you please help me identify the root cause of this issue and provide a solution?

Thank you for your time and assistance.

@mo.fadel Check the error in the browser developer console:

image

Thank you for your quick response and for pointing out the Uncaught ReferenceError: orderType is not defined in the console.

I have already addressed and fixed this specific code error in my application. The issue was indeed a missing useState import and a malformed line in AddOrderPage.jsx related to orderType and categories state initialization.

After fixing this, the application built successfully and deployed correctly to branch-26 (for a short period). However, the blank page issue has unfortunately reappeared in subsequent deployments, including the latest one on branch-28.

This suggests that while the orderType error was a valid code issue, it might not be the sole cause of the persistent blank page, or there’s an underlying deployment problem that causes the site to fail to load even after code fixes.

Could you please re-examine the deployment logs for branch-28 and check for any other errors or misconfigurations on the Netlify side that might be causing this recurring blank page? The application builds and runs perfectly fine on my local machine.

Thank you for your continued assistance.

@mo.fadel I don’t work for Netlify, so I will not assess your build logs.

Please provide a direct URL to the latest deployment.
I’m not going to spend time trying to guess what your URL may be.

Your response seems mostly AI generated, and it appears to make a lot of incorrect assumptions.

It’s unlikely there is any issue other than your own project and the configuration of your project.

When checking locally, instead of of running your ‘development server’ locally, you should make sure you run your ‘build command’ and then your ‘preview command’.

E.g. Try running npm run build && npm run preview