Skip to content
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

Deprecation warnings when on 4.11.4 #27265

Closed
1 of 2 tasks
CWSites opened this issue Jul 13, 2021 · 8 comments
Closed
1 of 2 tasks

Deprecation warnings when on 4.11.4 #27265

CWSites opened this issue Jul 13, 2021 · 8 comments
Labels
duplicate This issue or pull request already exists status: expected behavior Does not imply the behavior is intended. Just that we know about it and can't work around it v4.x

Comments

@CWSites
Copy link

CWSites commented Jul 13, 2021

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

When running my application using 4.11.4 I get the following "warnings" in my browsers console log which are actually formatted as console.error

vendor.js:41443 Material-UI: the createMuiTheme function was renamed to createTheme.

You should use `import { createTheme } from '@material-ui/core/styles'`
createMuiTheme @ vendor.js:41443
vendor.js:40734 Material-UI: The `fade` color utility was renamed to `alpha` to better describe its functionality.

You should use `import { alpha } from '@material-ui/core/styles'`
fade @ vendor.js:40734
vendor.js:98306 Warning: Failed prop type: Material-UI: `fontSize="default"` is deprecated. Use `fontSize="medium"` instead.
    at Icon (http://localhost:4200/vendor.js:18664:23)
    at WithStyles (http://localhost:4200/vendor.js:53805:31)
    at O (http://localhost:4200/vendor.js:101672:21572)
    at DotIcon (http://localhost:4200/vendor.js:782:24)
    at div
    at ListItemIcon (http://localhost:4200/vendor.js:22297:23)
    at WithStyles (http://localhost:4200/vendor.js:53805:31)
    at span
    at li
    at ButtonBase (http://localhost:4200/vendor.js:8536:22)
    at WithStyles (http://localhost:4200/vendor.js:53805:31)
    at ListItem (http://localhost:4200/vendor.js:21935:33)
    at WithStyles (http://localhost:4200/vendor.js:53805:31)
    at O (http://localhost:4200/vendor.js:101672:21572)
    at DotListItem (http://localhost:4200/vendor.js:2739:25)
    at ul
    at List (http://localhost:4200/vendor.js:21693:24)
    at WithStyles (http://localhost:4200/vendor.js:53805:31)
    at O (http://localhost:4200/vendor.js:101672:21572)
    at DotList (http://localhost:4200/vendor.js:2686:25)
    at Resources
    at div
    at O (http://localhost:4200/vendor.js:101672:21572)
    at div
    at O (http://localhost:4200/vendor.js:101672:21572)
    at div
    at O (http://localhost:4200/vendor.js:101672:21572)
    at Home (http://localhost:4200/main.js:14034:111)
    at DestinationsProvider (http://localhost:4200/main.js:15901:3)
    at Route (http://localhost:4200/vendor.js:95090:29)
    at PrivateRoute (http://localhost:4200/main.js:12100:89)
    at Switch (http://localhost:4200/vendor.js:95296:29)
    at Routes
    at section
    at main
    at O (http://localhost:4200/vendor.js:101672:21572)
    at div
    at O (http://localhost:4200/vendor.js:101672:21572)
    at MainLayout (http://localhost:4200/main.js:12474:3)
    at SidebarProvider (http://localhost:4200/main.js:16512:3)
    at div
    at O (http://localhost:4200/vendor.js:101672:21572)
    at App (http://localhost:4200/main.js:11958:78)
    at Ge (http://localhost:4200/vendor.js:101672:19082)
    at ThemeProvider (http://localhost:4200/vendor.js:52508:24)
    at StylesProvider (http://localhost:4200/vendor.js:52321:24)
    at DotThemeProvider (http://localhost:4200/vendor.js:4735:23)
    at Router (http://localhost:4200/vendor.js:94719:30)
    at BrowserRouter (http://localhost:4200/vendor.js:94325:35)
    at KeycloakProvider (http://localhost:4200/vendor.js:55767:51)
    at PermissionsProvider (http://localhost:4200/main.js:12056:3)

Expected Behavior 🤔

There should be no console errors for deprecation warnings... EVER. That's what console.warn is for.

Context 🔦

We are building a web application, our console log shouldn't be littered with "errors" that are actually deprecation warnings.

Your Environment 🌎

`npx @material-ui/envinfo`
Google Chrome, Firefox, Brave

  System:
    OS: macOS 11.4
  Binaries:
    Node: 15.11.0 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 7.6.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 91.0.4472.114
    Edge: Not Found
    Firefox: 86.0.1
    Safari: 14.1.1
  npmPackages:
    @material-ui/core:  4.12.1 
    @material-ui/lab:  4.0.0-alpha.60 
    @material-ui/styles:  4.11.4 
    @material-ui/system:  4.12.1 
    @material-ui/types:  5.1.0 
    @material-ui/utils:  4.11.2 
    @types/react: 16.9.56 => 16.9.56 
    react: 17.0.1 => 17.0.1 
    react-dom: 17.0.1 => 17.0.1 
    styled-components: 5.2.1 => 5.2.1 
    typescript: ~4.0.3 => 4.0.7 
@CWSites CWSites added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jul 13, 2021
@michal-perlakowski
Copy link
Contributor

Related: #21979, #15397.

@eps1lon
Copy link
Member

eps1lon commented Jul 14, 2021

Duplicate of #27195

@eps1lon eps1lon marked this as a duplicate of #27195 Jul 14, 2021
@eps1lon eps1lon closed this as completed Jul 14, 2021
@eps1lon eps1lon added status: expected behavior Does not imply the behavior is intended. Just that we know about it and can't work around it v4.x and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jul 14, 2021
@github-actions github-actions bot added the duplicate This issue or pull request already exists label Jul 14, 2021
@CWSites
Copy link
Author

CWSites commented Jul 14, 2021

Duplicate of #27195

Respectfully, we are on 4.11.4 NOT 4.12.x and we are seeing these errors. I updated our package.json to "@material-ui/core": 4.11.4 however when running yarn install it's bumping @material-ui/system to 4.12?

package.json

  "dependencies": {
    "@material-ui/core": "4.11.4",
    "@material-ui/lab": "^4.0.0-alpha.56",
  System:
    OS: macOS 11.4
  Binaries:
    Node: 15.11.0 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 7.6.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 91.0.4472.114
    Edge: Not Found
    Firefox: 86.0.1
    Safari: 14.1.1
  npmPackages:
    @emotion/styled:  10.0.27 
    @material-ui/core: 4.11.4 => 4.11.4 
    @material-ui/lab: ^4.0.0-alpha.56 => 4.0.0-alpha.58 
    @material-ui/styles:  4.11.4 
    @material-ui/system:  4.12.1 
    @material-ui/types:  5.1.0 
    @material-ui/utils:  4.11.2 
    @types/react:  17.0.11 
    react: 17.0.1 => 17.0.1 
    react-dom: 17.0.1 => 17.0.1 
    styled-components: ^5.2.1 => 5.3.0 
    typescript: ~4.0.3 => 4.0.8 

@eps1lon
Copy link
Member

eps1lon commented Jul 14, 2021

however when running yarn install it's bumping @material-ui/system to 4.12?

Yeah that's unfortunate. We should've pinned to minor when releasing the 4.11. release line. Make sure to pin every Material-UI package to before 4.12. yarn has resolutions for that.

@CWSites
Copy link
Author

CWSites commented Jul 14, 2021

Okay so using resolutions on @material-ui/system to 4.11 will resolve this?

@CWSites
Copy link
Author

CWSites commented Jul 14, 2021

That did it!

package.json

  "resolutions": {
    "@material-ui/system": "4.11.3"
  }
  System:
    OS: macOS 11.4
  Binaries:
    Node: 15.11.0 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 7.6.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 91.0.4472.114
    Edge: Not Found
    Firefox: 86.0.1
    Safari: 14.1.1
  npmPackages:
    @emotion/styled:  10.0.27 
    @material-ui/core: 4.11.4 => 4.11.4 
    @material-ui/lab: ^4.0.0-alpha.56 => 4.0.0-alpha.58 
    @material-ui/styles:  4.11.4 
    @material-ui/system:  4.11.3 
    @material-ui/types:  5.1.0 
    @material-ui/utils:  4.11.2 
    @types/react:  17.0.11 
    react: 17.0.1 => 17.0.1 
    react-dom: 17.0.1 => 17.0.1 
    styled-components: ^5.2.1 => 5.3.0 
    typescript: ~4.0.3 => 4.0.8 

@robcaldecott
Copy link
Contributor

These deprecation errors are causing us some problems too. We have a shared ThemeProvider used by many projects that is now generating an "error" because it's using createMuiTheme. Downgrading to 4.11 doesn't work because of the @material-ui/system issue and we're all using npm 6 where resolutions is not an option.

Short of us releasing a new theme that forces a dependency on 4.12 (and having to update a ton of projects) how can we hide these warnings? The noise of these warnings is confusion users, especially when running tests.

@eps1lon
Copy link
Member

eps1lon commented Jul 19, 2021

You need to also revert the lockfile changes that were included when upgrading from 4.11 to 4.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists status: expected behavior Does not imply the behavior is intended. Just that we know about it and can't work around it v4.x
Projects
None yet
Development

No branches or pull requests

4 participants