Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compile error '@material-ui/core' does not contain an export named 'makeStyles' after Material-ui-pickers installation

I need to use the inlineDatePicker components provided here by Material UI pickers: https://material-ui-pickers.dev/getting-started/installation

I ran the npm -i command however when I try to compile my code I get this error:

Failed to compile.

./node_modules/material-ui-pickers/dist/material-ui-pickers.esm.js
577:16-26 '@material-ui/core' does not contain an export named 'makeStyles'.

what? am I missing something? how do I get around this?

EDIT: So checking below, I checked the version and It gave me this error:

 peer dep missing: @material-ui/core@^4.0.0-alpha.7, required by [email protected]

so I did npm -i @material-ui/core@^4.0.0-alpha.7

and now I get another compile error...

 '@material-ui/core' does not contain an export named 'createStyles'.

Is there a version of @material-ui/core that I can install that will stop this madness?

like image 878
Haq.H Avatar asked Apr 15 '19 19:04

Haq.H


1 Answers

Thanks for testing v3 version of material-ui-pickers. You need also to install new @material-ui/styles package. Here is working codesandbox.

Also, make sure that you read the migration guide for v3.

like image 130
Dmitriy Kovalenko Avatar answered Nov 11 '22 07:11

Dmitriy Kovalenko