Search code examples
javascriptreactjsbrunch

Brunch build tool error while building react js


I am getting error while building react component using brunch build. what is this error about?

 error: Compiling of js/assets/jss/material-dashboard-pro-react/views/userProfileStyles.jsx failed. L5:4 js/assets/jss/material-dashboard-pro-react/views/userProfileStyles.jsx: Unexpected token 
     3 |   cardTitle,
     4 |   cardIconTitle: {
   > 5 |     ...cardTitle,
       |     ^
     6 |     marginTop: "15px",
     7 |     marginBottom: "0px",
     8 |     "& small": {

and got this error also

14:44:44 - error: Compiling of js/components/Accordion/Accordion.jsx failed. L22:15 Unexpected token 
     20 |     };
     21 |   }
   > 22 |   handleChange = panel => (event, expanded) => {
        |                ^
     23 |     this.setState({
     24 |       active: expanded ? panel : -1
     25 |     });

Solution

  • You are getting errors for spread syntax and class properties.

    You could install babel-brunch and a preset that contains both spread syntax and class properties, like the stage-2 preset.