Material-ui: I ran into a problem after switching to a new version1.0.0-rc.0 in my project

Created on 14 May 2018  路  5Comments  路  Source: mui-org/material-ui

Steps to Reproduce (for bugs)

  1. I switched to the new version v1.0.0-rc.0
  2. changed all the way to new. example: import { withStyles } from "@material-ui/core/styles";
  3. and my project started to give an error

Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

installed using yarn install@material-ui/core
old version deleted

Your Environment

| Tech | Version |
|--------------|---------|
| Material-UI | 1.0.0-rc.0 |
| React | 16.3.2 |
| browser | Chrome v66.0.3359.139 |

{
  "name": "react-chat",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@material-ui/core": "^1.0.0-rc.0",
    "@material-ui/icons": "^1.0.0-rc.0",
    "classnames": "^2.2.5",
    "material-ui": "^1.0.0-beta.47",
    "react": "^16.3.2",
    "react-dom": "^16.3.2",
    "react-router-dom": "^4.2.2",
    "react-scripts": "1.1.4",
    "typeface-roboto": "^0.0.54"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  }
}
incomplete

Most helpful comment

@vladseverin You might have forgotten some imports. Don't miss our codemod to fix all the occurrences: https://github.com/mui-org/material-ui/blob/master/packages/material-ui-codemod/README.md#import-path.

All 5 comments

@vladseverin You might have forgotten some imports. Don't miss our codemod to fix all the occurrences: https://github.com/mui-org/material-ui/blob/master/packages/material-ui-codemod/README.md#import-path.

@oliviertassinari Instead of saying warning [email protected]: You can now upgrade to @material-ui/core, how about instead linking to that README? Would have saved me a bunch of time and effort.

@octavioamu Also, the README instructions are for .js and I use .ts and .tsx. They also do not properly escape the @ in the shell, so the path isn't found.

@octavioamu Yep, as I suspected. No typescript support in jscodemod.

@oliviertassinari Thanks for the link, solved the problem by automatically changing paths

Was this page helpful?
0 / 5 - 0 ratings

Related issues

revskill10 picture revskill10  路  3Comments

ghost picture ghost  路  3Comments

zabojad picture zabojad  路  3Comments

anthony-dandrea picture anthony-dandrea  路  3Comments

reflog picture reflog  路  3Comments