Material-ui: Attempted import error: 'useIsFocusVisible' is not exported from '@material-ui/core/utils'.

Created on 14 Jun 2019  路  3Comments  路  Source: mui-org/material-ui


My project was working well until today when I updated the library. The error I receive is

/node_modules/@material-ui/lab/esm/Slider/Slider.js Attempted import error: 'useIsFocusVisible' is not exported from '@material-ui/core/utils'.

  • [ x] This is not a v0.x issue.
  • [x ] I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior 馃


Build should not fail

Current Behavior 馃槸


Build fails

Steps to Reproduce 馃暪


Link: codesandbox

  1. npx create-react-app my-app
  2. cd my-app
  3. npm install @material-ui/core @material-ui/icons @material-ui/lab
  4. npm start

Context 馃敠


Lift a backoffice in React

Your Environment 馃寧

| Tech | Version |
|--------------|---------------------|
| Material-UI | v4.0.0 |
| React | v16.8.3 |
| Browser | Chrome or Firefox |

question

Most helpful comment

@TatsuyaYamamoto is correct (thanks). You should see a peer dependency warning in your console when installing the lab package. A working example: https://codesandbox.io/s/material-demo-hd1l0.

The lab is in an alpha state, you might see breaking changes between two updates. It's what happens between alpha.15 and alpha.16 for the Slider component. Now, it should still work in the most simple use cases without any changes required.

All 3 comments

This problem does not happen in version 4.0.0-alpha.15 working example

@elgambet
Hi!
I found this problem in using @material-ui/core": "4.0.0" and @material-ui/lab": "4.0.0-alpha.16". I check that @material-ui/core/util/index export useIsFocusVisible in the latest code.
https://github.com/mui-org/material-ui/blob/master/packages/material-ui/src/utils/index.js

well, you can fix it by updating @material-ui/core

@TatsuyaYamamoto is correct (thanks). You should see a peer dependency warning in your console when installing the lab package. A working example: https://codesandbox.io/s/material-demo-hd1l0.

The lab is in an alpha state, you might see breaking changes between two updates. It's what happens between alpha.15 and alpha.16 for the Slider component. Now, it should still work in the most simple use cases without any changes required.

Was this page helpful?
0 / 5 - 0 ratings