I'm attempting to use the Customized snackbar component from the Material-UI Docs.
I'm copying the example code for the component given in the docs into a separate Snackbar.js file and then attempting to import the component into the PartnerProfile.js page within my web app.
I keep getting a failed to compile error:
./node_modules/@material-ui/lab/esm/internal/svg-icons/SuccessOutlined.js
Attempted import error: 'createSvgIcon' is not exported from '@material-ui/core/utils'.
I should be able just import the Snackbar.js file and display it in the PartnerProfile.js
The component works in the codesandbox but for some reason is not working in my app.
https://codesandbox.io/s/reverent-stonebraker-bst6f?fontsize=14&hidenavigation=1&theme=dark
Steps:
npm install @material-ui/lcore @material-ui/lab
import CustomizedSnackbars from './Snackbar'
in PartnerProfile.js<CustomizedSnackbars />
I'm trying to use this component to provide feedback to users on form submissions.
| Tech | Version |
| ----------- | ------- |
| Material-UI | v4.9.9 |
| React | v16.13.1 |
| Browser | Chrome |
馃憢 Thanks for using Material-UI!
We use GitHub issues exclusively as a bug and feature requests tracker, however,
this issue appears to be a support request.
For support, please check out https://material-ui.com/getting-started/support/. Thanks!
If you have a question on StackOverflow, you are welcome to link to it here, it might help others.
If your issue is subsequently confirmed as a bug, and the report follows the issue template, it can be reopened.
@benkitoko You should have a peer-dependency warning. You need to upgrade both core and lab to the latest version.
Hi all,
Just ran into the same issue when following the documentation on the Autocomplete helper
No peer dependency warning, ran npm update
, issue still exists.
Auto generated deps from package.json:
"@material-ui/core": "^4.9.10",
"@material-ui/icons": "^4.5.1",
"@material-ui/lab": "^4.0.0-alpha.49",
Got it resolved by removing node_modules
and package-lock.json
:shrug:
Kind regards
npm update
to get the below combination. It works!
"@material-ui/core": "^4.9.10",
"@material-ui/lab": "^4.0.0-alpha.49",
npm update
to get the below combination. It works!"@material-ui/core": "^4.9.10", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "^4.0.0-alpha.49",
It work ,thank you!
I solved it by update dependency like you , then remove package-lock and node-modules and reinstall.
I followed the steps above:
The original compilation error was fixed, but now I am getting a new one:
./node_modules/@material-ui/lab/esm/internal/svg-icons/ArrowDropDown.js
Attempted import error: 'createSvgIcon' is not exported from '@material-ui/core/utils'.
I'm getting the same issue as above with the lab .alpha-49 and core 4.9.10
I ran npm update, still got an error.
I removed node_modules and package.json, and still get the same 'createSvgIcon' is not exported from '@material-ui/core/utils'
error as I did before.
However, I updated to alpha-50 and core 4.9.11 and it worked just fine.
I had the same issue on ubuntu 16.04 but others on MacOS did not have any problems.
Changing the versions below seemed to fix it,
Previous versions,
"@material-ui/core": "4.7.0",
"@material-ui/lab": "^4.0.0-alpha.33",
New versions,
"@material-ui/core": "4.9.10",
"@material-ui/lab": "^4.0.0-alpha.49",
i run the command of "npm update" but i have still same error
Attempted import error: 'createSvgIcon' is not exported from '@material-ui/core/utils'
I also have this problem
I tried these 3 steps
Most helpful comment
npm update
to get the below combination. It works!