-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: __webpack_require__.i(...) is not a function when using createMuiTheme #7238
Comments
Can you share the stack trace of the issue? |
This is very strange. It is working now without changing anything. Just did a browser refresh and I'm not getting the error anymore. |
Feel free to reopen the issue if you can provide a reproduction test case then. Sounds like a issue on webpack land. |
@oliviertassinari While I got you here, I have a question regarding theme customization. I'm trying to change the primary color to blue, which works fine, except the focused input fields and labels still have the old color as you can see below: Here's my theme:
|
I think that it's expected, we use the accent hue of the primary color. Try out a different color to see that behavior. |
How do you recommend changing the color of the focused input fields and labels to be the same as the primary color? |
The easier one would be the change the |
Thank you. I'll give that a shot. |
@oliviertassinari I can't seem to figure out where to put the css overrides ( |
Here is an example mixing two approach: https://www.webpackbin.com/bins/-KnpurLIGtBVrZx27iEL const styleSheet = createStyleSheet('HelloWorld', theme => ({
inkbar: {
'&:after': {
backgroundColor: 'red'
}
}
}))
const HelloWorld = (props) => (
<TextField label="hello" InputProps={{classes: props.classes}} />
)
export default withStyles(styleSheet)(HelloWorld);
// ...
import { MuiThemeProvider, createMuiTheme } from 'material-ui/styles';
const theme = createMuiTheme({
overrides: {
MuiFormLabel: {
focused: {
color: 'red'
}
}
}
}); |
Thank you @oliviertassinari. That is very helpful. I can get the overriding of MuiFormLabel.focused color working using the Here's my code: const muiTheme = createMuiTheme({
palette: createPalette({
primary: blue,
}),
overrides: {
MuiFormLabel: {
focused: {
color: 'red'
}
},
MuiInput: {
inkbar: {
'&:after': {
backgroundColor: 'red'
}
}
}
}
}); I can see the style has been applied properly to the element in dev tool: But I don't see the red underline when I focus on the field: |
@krismartin I confirm, there is an issue here |
@krismartin We are doing a deep merge now. I'm expecting the issue to be fixed. |
I am facing the same problem but it is not getting resolved on browser refresh.
material_ui_raw_theme_file:
I am getting the error from getMuiTheme. webpack version: 2.2.0-rc.3
|
Getting same error after I updated from 1.0.0-beta.3 to 1.0.0-beta.5. import * as React from 'react';
import AppBar from 'material-ui/AppBar';
import Toolbar from 'material-ui/Toolbar';
import Button from 'material-ui/Button';
import IconButton from 'material-ui/IconButton';
import Typography from 'material-ui/Typography';
import MenuIcon from 'material-ui-icons/Menu';
import { withStyles, createStyleSheet } from 'material-ui/styles';
const styleSheet = createStyleSheet('Header', {
root: {
width: '100%',
},
flex: {
flex: 1,
},
});
const Logged = (props) => (
<MenuIcon
{...props}
iconButtonElement={
<IconButton></IconButton>
}
targetOrigin={{ horizontal: 'right', vertical: 'top' }}
anchorOrigin={{ horizontal: 'right', vertical: 'top' }}
>
<MenuIcon primaryText="Refresh" />
<MenuIcon primaryText="Help" />
<MenuIcon primaryText="Sign out" />
</MenuIcon>
);
function Header(props) {
const classes = props.classes;
return (<div>
<AppBar position="static" className={classes.root}>
<Toolbar>
<Typography type="title" color="inherit" className={classes.flex}>
Predictor
</Typography>
<Button color="contrast">Sign up</Button>
<Button color="contrast">Login</Button>
</Toolbar>
</AppBar>
</div>);
}
export default withStyles(styleSheet)(Header); |
@Tonvengo have a look at the CHANGELOG. |
Ok, thank you. Changed and it works now!
2017-08-17 17:21 GMT+02:00 Olivier Tassinari <[email protected]>:
… @Tonvengo <https://github.com/tonvengo> have a look at the CHANGELOG.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#7238 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ARwQ0umLY0kFoUQjkI8_7_SjiSlN-1pCks5sZFqAgaJpZM4OET6c>
.
--
With the best regards,
Vladimir Shulgin
|
What is the fix for this bug? I'm still running into it: https://stackoverflow.com/questions/47019815/material-ui-getmuitheme-missing-after-upgrading-from-0-9-to-1 |
I'm getting
TypeError: __webpack_require__.i(...) is not a function
error when calling the createMuiTheme. I followed the example code from https://material-ui-1dab0.firebaseapp.com/customization/themes.Versions
The text was updated successfully, but these errors were encountered: