Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

294
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda