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

Failed to compile the react-admin demo because of changes in @babel/runtime #2183

Closed
nikri opened this issue Aug 20, 2018 · 5 comments
Closed

Comments

@nikri
Copy link
Contributor

nikri commented Aug 20, 2018

When I have added the first part to the app.js and installed til ra-data-json-server, it gives me the following error:

Failed to compile.

./node_modules/@material-ui/icons/HotTub.js
Module not found: Can't resolve '@babel/runtime/helpers/builtin/interopRequireDefault' in '/Users/gan-nikri/GIT/react-admin/node_modules/@material-ui/icons'

It looks like there has been an update to babel runtime, where they have removed the folder "builtin", which results in the icons in the material-ui is failing.

Temporary fix for getting the demo to work:

Downgrade Babel Runtime to v7.0.0-beta.55:
yarn add @babel/[email protected] --exact

This will remove the bug, until Babel and Material-ui is compatible to each other again.

Environment

  • React-admin version: 2.2.0
  • React version: 16.4.2
  • Browser: Chrome latest
  • Babel runtime version: 7.0.0-rc1
  • Material-ui-core version: 1.5.1
  • Material-ui-icons version: 1.1.0
@nikri nikri changed the title Failed to compile because of changes in @babel Failed to compile the react-admin demo because of changes in @babel Aug 20, 2018
@nikri nikri changed the title Failed to compile the react-admin demo because of changes in @babel Failed to compile the react-admin demo because of changes in @babel/runtime Aug 20, 2018
@moritzmorgenroth
Copy link

moritzmorgenroth commented Aug 20, 2018

+1, same issue here. Thanks for opening the issue & the workaround, was just about to open one myself! This issue is independent of the data provider used.

@fzaninotto
Copy link
Member

This is a material-ui bug: mui/material-ui#12408

@nikri
Copy link
Contributor Author

nikri commented Aug 20, 2018

It doesn't look like it's added to a milestone yet :) Anyway, it works with the downgrade, so I'm happy. And it's an awesome solution you guys have build btw @fzaninotto

@djhi djhi closed this as completed Aug 20, 2018
@nareshbhatia
Copy link

Another workaround I found was to upgrade @material-ui/icons to version 2.0.3

@GoMino
Copy link

GoMino commented Sep 25, 2018

Indeed there is an incompatibility issue between material-ui/core version 1.5.1 and material-ui/icons 1.1.1 which are the last available v1.* version to date.
more infos: mui/material-ui#12621

So anyone trying to link with react-admin will have the issue.

You should probably fix the version of dependencies to the last one compatible by removing the caret:
"@material-ui/core": "^1.4.0",
"@material-ui/icons": "^1.0.0",

Replacing by the following should fixe the issue definitely:
"@material-ui/core": "1.5.0",
"@material-ui/icons": "1.1.0",

Thanks anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants