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

247
Views
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
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!