JGleason
JGleason

Reputation: 3926

ECMA6 classes not working on IE11 with Webpack and Babel

I am trying to get a React project to work with being packaged using Webpack and Babel using @babel/pollyfill. When I try to run on IE I get the following error...

SCRIPT1002: Syntax error

It is failing here...

class HealthCheck extends react__WEBPACK_IMPORTED_MODULE_0__["Component"]{
    render(){
        return _HealthCheck_jsx__WEBPACK_IMPORTED_MODULE_1__["HealthCheckTemplate"].call(this);
    }
}

So I am guessing it can't handle class so how do I fix this?

Upvotes: 1

Views: 2626

Answers (1)

Nick Lee
Nick Lee

Reputation: 852

Try using @babel/plugin-transform-classes .

https://babeljs.io/docs/en/babel-plugin-transform-classes

Upvotes: 1

Related Questions