-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[StylesProvider v5.22] Not woking when import #24302
Comments
@povilass Thank for help but I'm using minimizing-bundle-size with babel-plugin-transform-imports
My Theme: import { StylesProvider as StylesEngineProvider } from '@material-ui/core';
import { StylesProvider } from '@material-ui/styles';
<ThemeProvider theme={theme}>
<StylesEngineProvider injectFirst>
<StylesProvider>
<CssBaseline />
<GlobalStyles />
{children}
</StylesProvider>
</StylesEngineProvider>
</ThemeProvider> get Error => Module not found: Can't resolve '@material-ui/core/StylesProvider' in '/Volumes/DATA/_Trinh's Github/__Minimal Material Kit Pro/Minimal Material Kit Pro Standard v1.0.0/src/theme' |
import { StylesProvider as StylesEngineProvider } from '@material-ui/core'; comes from export { StylesProvider } from '@material-ui/styled-engine'; So you probably should include @material-ui/styled-engine in you plugin or use export { StylesProvider as StylesEngineProvider } from '@material-ui/styled-engine'; directly. https://codesandbox.io/s/containedbuttons-material-demo-forked-5bdh6?file=/index.js |
Thanks povilass, It's work for me, just only
=> It's worked, so many thank :) |
We will likely change the current imports, following #24109 (comment). |
Hello, This is my case:
Option 1: import { StylesProvider } from "@material-ui/core"; => Working (can override style)
https://prnt.sc/whxu7p
Option 2: import { StylesProvider } from "@material-ui/core/styles"; => Not working
https://prnt.sc/whxthg
https://codesandbox.io/s/containedbuttons-material-demo-forked-exdgd?file=/index.js:121-179
currently I cannot use option one Because i using:
https://next.material-ui.com/guides/minimizing-bundle-size/
I got an error when using option one,
Please help me, Thanks!
The text was updated successfully, but these errors were encountered: