Today I upgraded to version 1.0.0-beta.36, and when executing my build command (npm run build, I created the project with CRA) it gives the following error:
Failed to minify the code from this file: ./node_modules/material-ui-icons/es/AccessAlarm.js:9
It didn't happen with 1.0.0-beta.17 version. I downgraded and It allowed me to do the build with no problem.
Allow the build command to proceed.
Doesn't allow the build command to proceed.
npm version 5.8.0
node version v6.11.0
| Tech | Version |
|--------------|---------|
| Material-UI | 1.0.0-beta.36 |
| React | 16.3.0 |
| browser | Google Chrome v64 |
And when you compared the two versions of that file, what did you find?
@mbrookes ES6 syntax for 1.0.0-beta.36 version.
@racsoraul We had no /es folder in 1.0.0-beta.17. Nothing in our package.json is pointing to this folder. I have created a CRA project on my side to confirm the behevior:
import { AccessAlarm } from 'material-ui-icons'; // OK
import AccessAlarm2 from 'material-ui-icons/AccessAlarm'; // OK
import AccessAlarm3 from 'material-ui-icons/es/AccessAlarm'; // KO
[email protected]/es/AccessAlarm.js
The /es folder is a version of Material-UI that is up-to-date with all the currently supported features of the ECMAScript specification. Which mean we will only transpile stage features and apply our custom code transformations. So, it will only work with evergreen browsers.
I believe the problem is the minification using UglifyJS, so doing a minify with it should suffice to reproduce.
Yes, it's. UglifyJS only support ES5. Change your imports.
Most helpful comment
@racsoraul We had no
/esfolder in 1.0.0-beta.17. Nothing in ourpackage.jsonis pointing to this folder. I have created a CRA project on my side to confirm the behevior:[email protected]/es/AccessAlarm.jsThe
/esfolder is a version of Material-UI that is up-to-date with all the currently supported features of the ECMAScript specification. Which mean we will only transpile stage features and apply our custom code transformations. So, it will only work with evergreen browsers.Yes, it's. UglifyJS only support ES5. Change your imports.