dev_dy
dev_dy

Reputation: 143

Unable to import Material UI Labs into React app

Trying to use Material Ui Lab's checkboxes link. But after npm installing the three dependencies: @material-ui/lab, @material-ui/core and @material-ui/icons, I am receiving this error:

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

My imports are as follows:

import React from 'react';
import Checkbox from '@material-ui/core/Checkbox';
import TextField from '@material-ui/core/TextField';
import Autocomplete from '@material-ui/lab/Autocomplete';
import CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';
import CheckBoxIcon from '@material-ui/icons/CheckBox';

And the two dependency versions are:

"@material-ui/core": "^4.11.0",
"@material-ui/icons": "^4.5.1",
"@material-ui/lab": "^4.0.0-alpha.56"

I have tried deleting node modules and npm installing again to no avail, I've also tried to install @material-ui/utils.

Upvotes: 2

Views: 1027

Answers (1)

jack.benson
jack.benson

Reputation: 2363

I just created a working sandbox using the example from the docs. Compare your solution to that. If you are still unsure why it isn't working, we're going to need to see more code/config.

Upvotes: 3

Related Questions