Error in ./~/@remix-run/router/dist/router.cjs.js Module parse failed: /home/sharib/Desktop/Full Stack Developer Tutorial/MERN Stack/loginForm/loginform/node_modules/@remix-run/router/dist/router.cjs.js Unexpected token (1073:8) You may need an appropriate loader to handle this file type. SyntaxError: Unexpected token (1073:8) @ ./~/react-router-dom/dist/umd/react-router-dom.development.js 12:125-153
nodejs version : 16.17.0
npm version : 8.19.2
react-router version : 6.4.1
My App.js :-
import React, { Component } from "react";
import Navbar from "./Components/Navbar";
import Home from "./Components/Home";
import SignUp from "./Components/SignUp";
import { BrowserRouter, Routes, Route } from "react-router-dom";
import "./App.css";
const App =()=> {
return (
<BrowserRouter>
<Routes>
<Route path="/" element={<Navbar />}>
<Route index element={<Home />} />
<Route path="SignUp" element={< SignUp />} />
</Route>
</Routes>
</BrowserRouter>
);
};
export default App;
for me the issue was in react-scripts dunno why but it was 0.9.5 so i changed it to 5 .0 .1 then run npm i react-scripts and it worked
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With