Contents
React, Vue and Vite apps ship an index.html with almost no HTML in it: an empty element such as <div id="root"></div> and a script that fills it. If that script fails to load or crashes, the element stays empty and you get a white page with no message. That is why the fix starts in the browser’s developer tools, not in cPanel.
What you see and how to read it
Press F12 (or right-click, Inspect), open the Console tab and reload. You will usually find one of these:
GET https://example.com/src/main.jsx 404, or a MIME type error about a.jsxfile: you uploaded the source, not the build.GET https://example.com/assets/index-a1b2c3.js 404: asset paths do not match where the site lives.Uncaught TypeError: Cannot read properties of undefined: the code itself crashed, often because of a missing environment variable.- Nothing at all: a routing problem inside the app.
The most likely causes, and the fix for each
1. You uploaded the project instead of the build output
If File Manager shows package.json and a src folder inside public_html, this is it. Browsers do not understand JSX or TypeScript. On your computer run:
npm install
npm run build
Vite writes the result to dist, Create React App to build, recent Angular to dist/<project>/browser. Delete the old files from public_html and upload the contents of that folder, so index.html and assets sit directly in public_html. The full walkthrough is in the React deployment guide.
2. The app is in a subfolder and base is wrong
Vite builds asset URLs from the domain root (/assets/...). Put the site in public_html/app and the browser looks for example.com/assets and finds nothing. Set base in vite.config.js:
export default defineConfig({
plugins: [react()],
base: '/app/',
})
In Create React App, add "homepage": "https://example.com/app" to package.json. Then rebuild and upload again.
3. React Router does not know about the subfolder
In a subfolder, React Router sees /app/, finds no matching route and renders nothing, without an error. Add a basename:
<BrowserRouter basename="/app">
In Vue Router, createWebHistory(import.meta.env.BASE_URL) picks the value up from base automatically.
4. An environment variable was not in the build
Vite bakes environment variables into the JavaScript at build time; nothing reads them after upload. Their names must start with VITE_, and the .env file must exist on the machine that ran npm run build. If the code reads import.meta.env.VITE_API_URL and gets nothing, the whole app can crash. See .env not loaded on hosting.
5. The JavaScript files did not all arrive
An interrupted upload or a failed ZIP extract can leave assets missing. Compare the file count with your local dist folder and see ZIP upload or extract fails.
How to confirm it is fixed
Open the site in a private window so the browser cannot show an old copy. The Console should have no red errors, and the Network tab should show status 200 for the .js and .css files. Then open an inner page and reload it: if you get a 404, continue with 404 on refresh in a React or Vue app.
How to avoid it next time
- Test the build locally with
npm run previewbefore uploading. - Decide where the site will live (domain root or subfolder) before building, and set
baseandbasenametogether. - If an AI tool wrote the code, ask it explicitly to “prepare the project for static hosting”.
On ArabyHost
A static build from npm run build runs on every plan: upload it as a ZIP in File Manager from the panel, and LiteSpeed reads your .htaccess the way Apache does. If you cannot find the cause, ask the Araby AI assistant to read the error log and explain the fix. If your project has to be built on the server or needs a Node.js server, the AI/Developer plans include SSH and Node.js 20 and 24.
FAQ
Why does it work with npm run dev but not after upload?
npm run dev starts a development server that compiles .jsx and .tsx files on the fly. Hosting does not do that. Run npm run build and upload only the contents of the output folder, dist or build.
Do I upload the dist folder or what is inside it?
What is inside it. index.html and the assets folder must sit directly in public_html, not in public_html/dist, unless you set base to '/dist/'.
The page is blank and the console shows no error. Why?
Usually the app lives in a subfolder and React Router finds no route matching the URL, so it renders nothing. Add a basename matching your base path, or move the app to the domain root.
Does a React app need Node.js on the hosting?
Not if it is a single-page app built to static files. Node.js is only needed to build it on your machine, or if the project includes a server such as Next.js or Express.