Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

292
Views
React build page showing only header and footer

I'm trying to build my react app using the command 'npm run build' but when I view the index.html file (from build folder) on browser it shows only the header and footer.

Here are the codes from my App.js file:

import React from 'react';
import './App.css';
import Header from './components/Header/Header';
import {BrowserRouter as Router, Switch, Route} from 'react-router-dom';
import Home from './components/pages/Home';
import Resume from './components/pages/Resume';
import Contact from './components/pages/Contact';
import Footer from './components/Footer/Footer';
function App() {
  return (
      <Router>
        <section className="mainWrap">
          <Header/>
          <Switch>
            <Route path='/' exact component={Home}  />
            <Route path='/Resume' exact component={Resume}  />
            <Route exact path="/http://bright-webs.com/portfolio.html" render={() => (window.location = "http://bright-webs.com/portfolio.html")} />
            <Route path='/Contact' exact component={Contact}  />
          </Switch>
          <Footer/>
        </section>
      </Router>
  );
}
export default App;

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I think you are trying to deploy the react build on CPanel and experiencing this issue.

In order to resolve this issue when you upload the build zip on Cpanel, after extracting the build folder copy all files which are inside the build folder and than move it inside the public_html and now you can see your project working

Also, remember to add homepage inside package.Json before running build command.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!