-
-
Notifications
You must be signed in to change notification settings - Fork 5.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
Pagination fails with *TypeError: onChangePage is not a function* #6421
Comments
I ran into the same issue right now. It seems |
Exactly, the problem is that material ui added some breaking changes in a minor release and react-admin requieres ^4.11.4 |
I think I found a workaround for the time being. Using yarn in my package.json I added this
and now the pagination is working as intended |
For a long time I took it as a rule: third-party package dependencies are not a constant thing, and in all my projects I never use "^" in package versions, which is what I wish for you. |
just encountered the same issue |
This is due to a breaking change released in a minor release on June 6th by material-ui, a library react-admin depends on. We're asking them to undo this change in mui/material-ui#23789 and publish a new release. Please voice your opinion at mui/material-ui#27192 if you have the same problem. |
Using npm, installing |
Problem solved by your solution. |
Sadly, it is not working for me. The error is still present. :( |
If you are using npm, you can install the material-ui version which works with react-admin with:
This will add next dependency to package.json file:
This can help right away if your project already installed previous dependencies because this one will be just installed directly via terminal and overwrite previous (presuming materialui/core 4.12.x which fails). Also you can add the same way
I hope this can help to remove all potential breaking errors. |
If you use
|
I removed node_modules and run "yarn install" |
Lol, it is workin'! 👍 🥇 But moreover, you have to fix the versions, like that below, if you use the dependencies: {
"@material-ui/core": "4.11.2",
"@material-ui/lab": "4.0.0-alpha.57",
"@material-ui/pickers": "3.2.10",
"ra-ui-materialui": "^3.16.5",
"react-admin": "^3.16.5",
...
}
"resolutions": {
...
"react-admin/@material-ui/core": "4.11.2"
}, because this warning: WARN Compiled with 1 warnings 9:51:36 PM
warn in ./node_modules/@material-ui/lab/esm/PaginationItem/PaginationItem.js 9:51:36 PM
export 'alpha' (imported as 'alpha') was not found in '@material-ui/core/styles' (possible exports: MuiThemeProvider, ServerStyleSheets, StylesProvider, ThemeProvider, createGenerateClassName, createMuiTheme, createStyles, darken, decomposeColor, duration, easing, emphasize, fade, getContrastRatio, getLuminance, hexToRgb, hslToRgb, jssPreset, lighten, makeStyles, recomposeColor, responsiveFontSizes, rgbToHex, styled, unstable_createMuiStrictModeTheme, useTheme, withStyles, withTheme) |
Material-ui just released 4.12.3, which should fix this issue. https://github.com/mui-org/material-ui/releases/tag/v4.12.3 I'm closing the GitHub issue, please only comment here if you're still having the problem after upgrading to mui > 4.12.3 |
@fzaninotto So is react-admin upgrading to this or do we just need to install mui manually now? |
react-admin only has a peerDependency on material-ui. We don't specify the version you need. That's what caused the problem in the first place, as people started to install mui v4.12.0 when it was released a couple weeks ago. so we don't need to re-release react-admin for the problem to be fixed. |
Thanks @fzaninotto |
@fzaninotto that doesn't seem to be the case? react-admin/packages/react-admin/package.json Lines 36 to 38 in a21f80e
|
The tip by @davidsondefaria worked for me (I'm using yarn), this is the set of package versions that removed the errors for me:
|
@abdusco the Again, the fix isn't in the react-admin code, it's in the mui code. we have nothing to do on our side. |
@fzaninotto True. But if it had So I agree with you that it's not a problem on |
What you were expecting:
For pagination to work
What happened instead:
Pagination didn't work and throws this error:
Steps to reproduce:
Installed latest react-admin v3.16.6 and run tutorial example
Related code:
This is the tutorial just using version 3.16.6
https://codesandbox.io/s/cool-tdd-8x1lk?file=/package.json
Environment
The text was updated successfully, but these errors were encountered: