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

228
Views
React cannot use hashrouter

I use babel and webpack to bundle the react app.When I import the Router, the page presents white. And the log below :

Uncaught ReferenceError: exports is not defined
    at Module../node_modules/@babel/runtime/helpers/esm/extends.js (index.css:9:1)
    at __webpack_require__ (bootstrap:24:1)
    at fn (hot module replacement:62:1)
    at Object../node_modules/history/index.js (index.ts:20:1)
    at __webpack_require__ (bootstrap:24:1)
    at fn (hot module replacement:62:1)
    at Object../node_modules/react-router-dom/index.js (index.js:38:2)
    at __webpack_require__ (bootstrap:24:1)
    at fn (hot module replacement:62:1)
    at Object../src/App.jsx (App.jsx:5:1)

and my code :

import React from "react"
import Look from "./components/Look.jsx"
import Edit from "./components/Edit.jsx"
import "./css/index.css"
import { HashRouter, Routes, Route } from "react-router-dom";

export default function App() {
    return (
        <>
            <h1 className="title">App</h1>
            <HashRouter>
                <Routes>
                    <Route path='/' element={<Edit />} />
                    <Route path='/look' element={<Look />} />
                </Routes>
            </HashRouter>
        </>
    )
}
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!