question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Attempted import error: 'useBlocker' is not exported from 'react-router-dom'.

See original GitHub issue

Getting Attempted import error:

package.json { "name": "my-cms", "version": "0.1.0", "private": true, "dependencies": { "@camberi/firecms": "^1.0.0-beta2", "@emotion/react": "^11.4.1", "@emotion/styled": "^11.3.0", "@mui/icons-material": "5", "@mui/lab": "^5.0.0-alpha.49", "@mui/material": "5", "@mui/styles": "5", "firebase": "9", "@testing-library/jest-dom": "^5.11.4", "@testing-library/react": "^11.1.0", "@testing-library/user-event": "^12.1.10", "@types/jest": "^26.0.15", "@types/node": "^12.0.0", "@types/react": "^17.0.0", "@types/react-dom": "^17.0.0", "react": "^17.0.2", "react-dom": "^17.0.2", "react-router": "^6.0.0-beta.7", "react-router-dom": "^6.0.0-beta.7", "react-scripts": "4.0.3", "typescript": "^4.1.2", "web-vitals": "^1.0.1" }, "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" }, "eslintConfig": { "extends": [ "react-app", "react-app/jest" ] }, "browserslist": { "production": [ ">0.2%", "not dead", "not op_mini all" ], "development": [ "last 1 chrome version", "last 1 firefox version", "last 1 safari version" ] } }

Node Version: v12.20.0 Npm Version: 6.14.8 Yarn version: 1.22.10

Tried via yarn and node. Unable to kickstart project. Did upgrading of node version as well. Please suggest anything which works

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
fgatti675commented, Oct 19, 2021

That is correct, they have unfortunately removed useBlocker from react-router, We will fix it in the next version

0reactions
luisluftcommented, Dec 10, 2021

Getting the same error with these versions: "react": "^17.0.1", "react-dom": "^17.0.1", "react-router-dom": "^6.0.2",

Read more comments on GitHub >

github_iconTop Results From Across the Web

Attempted import error: 'Route' is not exported from 'react ...
I'm following the guidance to use only react-router-dom and import BrowserRouter and Route from react-router-dom. But I'm getting an error: ./ ...
Read more >
How To Fix - "Attempted Import Error: 'Switch' is Not Exported ...
In this post, we will see How To Fix – “Attempted Import Error: 'Switch' is Not Exported From 'react-router-dom' in React.js, React-Router-Dom.
Read more >
How to Fix Attempted Import Error Switch is Not Exported From ...
Command:- npm install react - router - dom @5.3.0In This Video We Will See How to Fix Attempted Import Error Switch is Not...
Read more >
'useHistory' is not exported from 'react-router-dom ... - YouTube
bongoogle. Visit: http://bongoogle.com/react js tutproan Attempted import error : 'useHistory' is not exported from 'react - router - dom ' export ...
Read more >
React router v6 - useBlocker - retry not working - CodeSandbox
Forked FromReact router v6 - useBlocker - retry working; Environmentcreate-react-app. Files. example.js. index.html. index.js. package.json. react-router2.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found