Material-ui: Cannot read property 'charAt' of undefined when changing palette on 1.0.0-rc.0.

Created on 15 May 2018  Â·  3Comments  Â·  Source: mui-org/material-ui

Hi there!

I've searched everywhere and from what I've seen this _was already fixed_ but I can't get rid of it after I today upgraded from beta 47 to 1.0.0-rc.0.

So — I'm trying to change the color palette. Here's an example:

Material.js

import { createMuiTheme } from "@material-ui/core/styles";

const MuiTheme = createMuiTheme({
  typography: {
    htmlFontSize: 10
  },
  palette: {
    primary: {
      main: "#000000"
    }
  }
});

export default MuiTheme;

index.js

import { MuiThemeProvider } from "@material-ui/core/styles";
import MuiTheme from "./Material";

ReactDOM.render(
  <Router>
      <MuiThemeProvider theme={MuiTheme}>
        <App />
      </MuiThemeProvider>
  </Router>,
  document.getElementById("root")
);

Here are the errors:
image 2018-05-15 at 6 55 12 pm

The only solutions I've found is removing MuiThemeProvider that wrapps the App and that's... not really a solution. :)

incomplete

Most helpful comment

Aaaah.
I had import Button from "material-ui/Button"; buried somewhere in the app.
Thanks a lot, you saved me! 😅

All 3 comments

@benjam1n The error comes from an old version of material-ui. Check your dependency tree. Something is off.

It's definitely not @material-ui/core.

capture d ecran 2018-05-15 a 19 08 16

Aaaah.
I had import Button from "material-ui/Button"; buried somewhere in the app.
Thanks a lot, you saved me! 😅

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ryanflorence picture ryanflorence  Â·  3Comments

rbozan picture rbozan  Â·  3Comments

TimoRuetten picture TimoRuetten  Â·  3Comments

pola88 picture pola88  Â·  3Comments

newoga picture newoga  Â·  3Comments