Material-ui: [5.0.0-alpha.5] 'useThemeVariants' is not exported from '@material-ui/styles'

Created on 28 Jul 2020  路  3Comments  路  Source: mui-org/material-ui

Upgrading from 5.0.0-alpha.4 to 5.0.0-alpha.5 breaks compilation with the following

Failed to compile.

./node_modules/@material-ui/core/esm/Button/Button.js
Attempted import error: 'useThemeVariants' is not exported from '@material-ui/styles'.

Environment 馃寧


Using an un-ejected create-react-app 3.4.1 project with --typescript template

| Tech | Version |
| ----------- | ------- |
| Material-UI | v5.0.0-alpha.5 |
| React | 16.13.1 |
| Browser | Chrome 84.0.4147.89 (Official Build) (64-bit) |
| TypeScript | 3.8.2 |
| etc. | |

tsconfig

{
  "compilerOptions": {
    "target": "es5",
    "lib": [
      "dom",
      "dom.iterable",
      "esnext"
    ],
    "allowJs": true,
    "skipLibCheck": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "jsx": "react"
  },
  "include": [
    "src"
  ]
}

bug 馃悰

Most helpful comment

I have released a new version of @material-ui/styles to solve the issue for new installations: https://codesandbox.io/s/98luw?file=/demo.js. For existing ones, you will need to clear the package manager lock file. Or wait for v5.0.0-alpha.6.

All 3 comments

I found same question under 5.0.0-alpha.5

same here using on nextjs

I have released a new version of @material-ui/styles to solve the issue for new installations: https://codesandbox.io/s/98luw?file=/demo.js. For existing ones, you will need to clear the package manager lock file. Or wait for v5.0.0-alpha.6.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mb-copart picture mb-copart  路  3Comments

pola88 picture pola88  路  3Comments

ryanflorence picture ryanflorence  路  3Comments

mattmiddlesworth picture mattmiddlesworth  路  3Comments

sys13 picture sys13  路  3Comments