bug: react router dom 4.3.1 pulling react-router 4.4.0 changes after latest publish
See original GitHub issueI’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.
Issue Analytics
- State:
- Created 5 years ago
- Comments:39 (15 by maintainers)
Top Results From Across the Web
bug: react router dom 4.3.1 pulling react-router 4.4.0 changes ...
I'm seeing the following error: Warning: Please use `require("react-router").Router` instead of `require("react-router/Router")`.
Read more >Tutorial v6.6.1 - React Router
Open up your terminal and bootstrap a new React app with Vite: ... This first route is what we often call the "root...
Read more >Ion React Router does not route pages - Stack Overflow
My understanding is that ion react router is built on top of react router dom and that it functions pretty similarly.
Read more >React Router v6 Preview
Ryan and I have been working on React Router since May 2014 ... One of the most exciting changes in v6 is the...
Read more >react-router-dom - npm
Declarative routing for React web applications. Latest version: 6.4.2, last published: 8 days ago. Start using react-router-dom in your ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Quick update for anyone who’s watching this issue: I just unpublished 4.4.0 and re-released it as 5.0.0. v5 should be out as soon as https://travis-ci.org/ReactTraining/react-router/jobs/507926860 finishes.
Can confirm this bug with both yarn 1.15.2 and npm 6.9.0.
Curiously, codesandbox doesn’t have this issue.
Reproduction: https://github.com/StringEpsilon/react-router-bug-6630 (
npm i; npm run start)Edit: As a workaround, you can simply add
or more explicetly:
to your package.json.