Lester Ivan Dalaguit
Lester Ivan Dalaguit

Reputation: 11

import {BrowserRouter, Router, Route} from 'react-router-dom'; brought 15 errors

ERROR in ./node_modules/react-router-dom/dist/index.js 13:0-836 export 'AbortedDeferredError' (reexported as 'AbortedDeferredError') was not found in 'react-router' (possible exports: Await, MemoryRouter, Navigate, Outlet, Route, Router, RouterProvider, Routes, UNSAFE_DataRouterContext, UNSAFE_DataRouterStateContext, UNSAFE_DataStaticRouterContext, UNSAFE_LocationContext, UNSAFE_NavigationContext, UNSAFE_RouteContext, UNSAFE_enhanceManualRouteObjects, createMemoryRouter, createRoutesFromChildren, createRoutesFromElements, renderMatches, useActionData, useAsyncError, useAsyncValue, useHref, useInRouterContext, useLoaderData, useLocation, useMatch, useMatches, useNavigate, useNavigation, useNavigationType, useOutlet, useOutletContext, useParams, useResolvedPath, useRevalidator, useRouteError, useRouteLoaderData, useRoutes)

Upvotes: 0

Views: 12683

Answers (4)

JanYknta
JanYknta

Reputation: 26

Restart your react development server:

  • Just stop your running react development server running at port 3000 or 5000 by pressing Ctrl + c in your terminal.
  • Then restart your development server by entering npm start (If CRA) or npm run dev (If Vite)

This has fixed the issue for me.

Upvotes: 0

Sophia
Sophia

Reputation: 1

make sure you are installing react-dom, react-router, and react-router-dom in the right directory

Upvotes: 0

Kitty
Kitty

Reputation: 149

If you installed this while your React app was running, stop it and restart. This fixed the same problem for me. Apparently it's supposed to detect new installs, but it didn't for me.

Upvotes: 4

Kosi
Kosi

Reputation: 105

Do this.

Import {BrowserRouter as Router, Routes, Route} from "react-router-dom";
Import React from 'react';

Also make sure that you have installed the following packages;

react-dom, react-router, react-router-dom.

Upvotes: 1

Related Questions