react-jsonschema-form: Errors with version 4.0 and material-ui 4

Installing version 4.0 @rjsf/core and @rjsf/material-ui, alongside with my material-ui 4, I get the warning

npm WARN @rjsf/material-ui@4.0.0 requires a peer of @rjsf/core@^3.0.0 but none is installed. You must install peer dependencies yourself.

(and indeed, in the package.json of @rjsf/material-ui one finds “@rjsf/core@^3.0.0” , that seems wrong)

Furthermore, if I ignore the install warning , npm start gives compile warnings

./node_modules/@rjsf/material-ui/dist/material-ui.esm.js
Module not found: Can't resolve '@mui/icons-material' in 'C:\wk\pcnt\trake\trake-ui\node_modules\@rjsf\material-ui\dist'

./node_modules/@rjsf/material-ui/dist/material-ui.esm.js
Module not found: Can't resolve '@mui/material' in 'C:\wk\pcnt\trake\trake-ui\node_modules\@rjsf\material-ui\dist'   

… and when runnning I get on console

Error: Cannot find module '@mui/material'
    at webpackMissingModule (material-ui.esm.js:1256:1)
    at Module../node_modules/@rjsf/material-ui/dist/material-ui.esm.js (material-ui.esm.js:1256:1)

Using react 17 and Node 14 with

@material-ui/core: 4.12.3 @material-ui/system: 4.12.1 @material-ui/icons 4.11.2 @rjsf/core: 4.0.0 @rjsf/material-ui: 4.0.0

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (8 by maintainers)

Commits related to this issue

Most upvoted comments

I’m still getting Module not found: Can’t resolve ‘@material-ui/core’ warnings when using 4.0.1.

Will work on this soon

This is a known issue with the way Mui 4 and 5 support were built to be side-by-side. There are webpack tricks that can be used to eliminate the warnings. …

Yes, and like in #2762 was mentioned, that is hard to do with CRA.

Does this mean that there is not going to be a fix for this in near future?

How about you separate the Mui4 and Mui5 into separate packages and possible mark v4 as legacy version?

I and the users in #2762 are still having the same errors with v4.1.0 as are being posted in that issue.