I'm developing a Chrome extension with React but I can't get rid of this warning: No routes matched location "/popup.html", it cause the app simply to not start.
I used this template to create the app and my App.js looks like this:
import { BrowserRouter as Router, Route, Routes } from "react-router-dom"
import PrivateRoute from "./components/PrivateRoute"
function App() {
return (
<Router>
<AuthProvider>
<Routes>
<Route exact path="/dashboard" element={<PrivateRoute> <Dashboard /> </PrivateRoute> } />
<Route path="/signup" component={Signup} />
<Route path="/login" component={Login} />
<Route path="/forgot-password" component={ForgotPassword} />
<Route exact path="/update-profile" element={<PrivateRoute> <UpdateProfile /> </PrivateRoute> } />
</Routes>
</AuthProvider>
</Router>
)
}
export default App;
Before using routes, having just return (<Signup/>) worked but not everything is broken.
So I just found a simple answer if that can help people:
Just replace import { BrowserRouter } with import { HashRouter } and that will work perfectly fine