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

core 1.5.1 breaks icons 1.* #12621

Closed
2 tasks done
sergey-su opened this issue Aug 22, 2018 · 15 comments
Closed
2 tasks done

core 1.5.1 breaks icons 1.* #12621

sergey-su opened this issue Aug 22, 2018 · 15 comments
Assignees
Labels
bug 🐛 Something doesn't work

Comments

@sergey-su
Copy link

sergey-su commented Aug 22, 2018

Building breaks for users of @material-ui/icons 1.1.0 with error

Error: Cannot find module '@babel/runtime/helpers/builtin/interopRequireDefault' from '.../node_modules/@material-ui/icons'

@material-ui/icons 1.1.0 declares that it works with any core of v1

  "peerDependencies": {
    "@material-ui/core": "^1.0.0-rc.0",

but that's not true for 1.5.1.
1.5.1 depends on @babel/runtime 7.0.0-rc.1 as opposed to 7.0.0-beta.42 in 1.5.0. 7.0.0-rc.1 changes the location of interopRequireDefault.

Expected Behavior

icons v1 can be used

Current Behavior

Error: Cannot find module '@babel/runtime/helpers/builtin/interopRequireDefault' from '.../node_modules/@material-ui/icons'

Steps to Reproduce

https://codesandbox.io/s/oow4nvrm36

Proposal

Release icons 1.1.1 that would work with core 1.5.1 and babel core 7.0.0-rc.1

@sergey-su
Copy link
Author

Workaround that works for me

  "dependencies": {
    ...
    "@material-ui/core": "1.5.0",
    "@material-ui/icons": "1.1.0",
     ...
  },
  "optionalDependencies": {
    "@babel/runtime": "7.0.0-beta.42",
    "react-event-listener": "0.6.2"
  }

@oliviertassinari
Copy link
Member

oliviertassinari commented Aug 22, 2018

Should be fixed by #12605.

@oliviertassinari oliviertassinari added the bug 🐛 Something doesn't work label Aug 22, 2018
@oliviertassinari
Copy link
Member

oliviertassinari commented Aug 22, 2018

Oh no, my bad. It's @material-ui/icons@1.1.0 that is broken in the first place. It was fixed one month ago with: #12170. You just need to upgrade @material-ui/icons.

@sergey-su
Copy link
Author

@oliviertassinari , do you say icons v1 is not supported any more? That's sad because icons v2 do not work with react 15. See https://codesandbox.io/s/ymmnjxn6xv.

@oliviertassinari
Copy link
Member

oliviertassinari commented Aug 22, 2018

@sergey-su We don't support older versions. We almost never did. React 15.x support stopped 4 months ago.

@fzaninotto
Copy link
Contributor

I'm concerned about this.

As @material-ui/icons@2.0 is a breaking change over 1.1, the fact that @material-ui/core@1.5.1 requires us to upgrade @material-ui/icons to 2.0 IS a breaking change for the core. So core 1.5.1 should have been a 2.0 in that regard.

Alternatively, please revert the babel upgrade in 1.5.1, or backport the material-ui/icons fix to the 1.x branch.

@oliviertassinari
Copy link
Member

@fzaninotto Fair point. I guess we can make a patch release for @material-ui/icons@1.x.

@oliviertassinari
Copy link
Member

@material-ui/icons@1.1.1 is out with the fix, I hope that help.

@fzaninotto
Copy link
Contributor

Thanks!

@anuraaga
Copy link

anuraaga commented Aug 30, 2018

Hi @oliviertassinari. I'm trying to understand the fix in 1.1.1 - is it supposed to have republished the package having been built with babel 7.0.0-rc.1? The package.json still specifies a dependency on 7.0.0-beta.42 and trying to use 1.1.1 still has the same Can't resolve '@babel/runtime/helpers/builtin/interopRequireDefault error as before when used with babel 7.0.0

@oliviertassinari
Copy link
Member

@anuraaga v1.1.1 is about locking the babel runtime version to the version that was used to generate the code: beta.42. Make sure the issue isn't coming from another dependency.

@anuraaga
Copy link

But the dependency that causes the problem is @material-ui/core itself since 1.5.1 depends on 7.0.0-rc.1, and when both core 1.5.1 and icons 1.1.1 are depended on, babel resolves to 7.0.0-rc.1. It's of course possible to fix the version to 7.0.0-beta.55 using yarn's resolutionDependencies, which is a workaround, but it seems like without such workarounds, core 1.5.1 and icons 1.1.1 still aren't compatible?

@oliviertassinari
Copy link
Member

@anuraaga Unless you are flattening your node_modules, multiple versions of babel will be installed, it shouldn't be an issue at all.

@GoMino
Copy link

GoMino commented Sep 25, 2018

@anuraaga, I confirm this issue @oliviertassinari, had installed both core 1.5.1 and icons 1.1.1 and the issue still occur

@fzaninotto
Copy link
Contributor

fzaninotto commented Apr 5, 2019

I confirm this fix by @oliviertassinari isn't effective. Using core v1.5.1 with icons v1.1.1 still fails with a Babel error

fzaninotto added a commit to marmelab/react-admin that referenced this issue Apr 5, 2019
To avoid conflict with material-ui icons, see mui/material-ui#12621
ghodsizadeh pushed a commit to ghodsizadeh/react-admin that referenced this issue May 21, 2019
To avoid conflict with material-ui icons, see mui/material-ui#12621
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work
Projects
None yet
Development

No branches or pull requests

5 participants