profile
viewpoint

Ask questionsbug: react router dom 4.3.1 pulling react-router 4.4.0 changes after latest publish

I'm seeing the following error:

   Warning: Please use `require("react-router").Router` instead of `require("react-router/Router")`. Support for the latter will be removed in the next major release.

 console.error node_modules/react-router-dom/node_modules/react-router/warnAboutDeprecatedCJSRequire.js:17
   Warning: Please use `require("react-router").MemoryRouter` instead of `require("react-router/MemoryRouter")`. Support for the latter will be removed in the next major release.

 console.error node_modules/react-router-dom/node_modules/react-router/warnAboutDeprecatedCJSRequire.js:17
   Warning: Please use `require("react-router").Route` instead of `require("react-router/Route")`. Support for the latter will be removed in the next major release.

 console.error node_modules/react-router-dom/node_modules/react-router/warnAboutDeprecatedCJSRequire.js:17
   Warning: Please use `require("react-router").Prompt` instead of `require("react-router/Prompt")`. Support for the latter will be removed in the next major release.

 console.error node_modules/react-router-dom/node_modules/react-router/warnAboutDeprecatedCJSRequire.js:17
   Warning: Please use `require("react-router").Redirect` instead of `require("react-router/Redirect")`. Support for the latter will be removed in the next major release.

 console.error node_modules/react-router-dom/node_modules/react-router/warnAboutDeprecatedCJSRequire.js:17
   Warning: Please use `require("react-router").StaticRouter` instead of `require("react-router/StaticRouter")`. Support for the latter will be removed in the next major release.

 console.error node_modules/react-router-dom/node_modules/react-router/warnAboutDeprecatedCJSRequire.js:17
   Warning: Please use `require("react-router").Switch` instead of `require("react-router/Switch")`. Support for the latter will be removed in the next major release.```


Inside the package.json file of react-router dom:

```"dependencies": {
   "history": "^4.7.2",
   "invariant": "^2.2.2",
   "loose-envify": "^1.3.1",
   "prop-types": "^15.5.4",
   "react-router": "^4.3.1",
   "warning": "^3.0.0"
 },```

It's downloading 4.4.0 due to this.
ReactTraining/react-router

Answer questions sPaCeMoNk3yIam

I still got this problem now:

WARNING in ./node_modules/react-router/esm/react-router.js 324:15-27
"export 'default' (imported as 'pathToRegexp') was not found in 'path-to-regexp'
 @ ./node_modules/react-router-dom/esm/react-router-dom.js
 @ ./src/index.jsx
useful!

Related questions

Route is not exported in react-router-dom
Cannot read property 'location' of undefined at useLocation hot 4
Error: Invariant failed: You should not use <Switch> outside a <Router> hot 3
Replace componentWillMount by UNSAFE_componentWillMount for v3 hot 3
Failed prop type: Invalid prop 'component' supplied to 'Route': the prop is not a valid React component hot 2
useParams and other new hooks are not exported in react-router-dom & react-router hot 2
Prompt in React 16 "Warning: A history supports only one prompt at a time" hot 1
Use new forwardRef API in withRouter HOC hot 1
Fix <Route children> hot 1
Route is not exported in react-router-dom hot 1
[React.memo] Warning: Failed prop type: Invalid prop `component` of type `object` supplied to `Route`, expected `function` hot 1
Receiving ESM Error but not using ESM hot 1
useParams returns empty object when used outside of Route hot 1
useParams and other new hooks are not exported in react-router-dom & react-router hot 1
Add useRouter Hook - react-router hot 1
Github User Rank List