Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

251
Vistas
How to use React Routes with esbuild?

I'm using esbuild to create React app, its working good, but, when I tried to enable react-router on the app, it can be builder and works, but I'm not able to move between routes, the initial config:

(async () => {
const builder = await build({
    bundle: true,
    define: {"process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV || 'dev')},
    entryPoints: ["app/index.tsx"],
    incremental: true,
    minify: process.env.NODE_ENV === 'prod',
    
    outfile: './app/public/main.js',
    loader: {
        '.svg': 'dataurl',
        '.png': 'dataurl'
    },
    
});

chokidar.watch("app/src/**/*.{ts,tsx}", {
    interval: 0
}).on("all", () => {
    builder.rebuild()
});

liveServer.start({
    open: true,
    port: process.env.PORT || 8080,
    root: './app/public'
}) })();

And my routes are declare:

<Routes>
    <Route path={'/'} element={<Login />} />
    <Route path={'register'} element={<Register />} />
</Routes>

but the server gives me: Cannot GET /register

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda