ES6 Error on Meteor App Build


#1

Hi Meteor, I’m getting some odd errors on build when using the new ES6 features. Typically when I’m dealing with static variables and React’s context.

Here’s what the error looks like:

Errors prevented startup:

While building for web.browser:
imports/ui/layouts/App.jsx:13:1: /imports/ui/layouts/App.jsx: Missing class properties transform.

Your application has errors. Waiting for file change.

Has anyone else experienced this, and do you know any ways to workaround/fix this issue?


#2

Are you using the static language construct? Perhaps with propTypes?

I know that some of the React pages refer to them, but I have not been able to get them working. I am instead adding the propTypes as “oldstyle” statics by defining them below the class.

import React, {Component} from 'react';
export default class MyComponent extends Component {
    render() {
        return (
            // JSX
        )
    }
}
MyComponent.propTypes = {
    // propTypes definition
}
MyComponent.defaultProps = {
    // defaultProps definition
}

#3

Yup, I was. I ended up adding Babel’s transform-class-properties plugin and configuring it in my package.json file.

It works great with the standard static keyword now.


#4

Cool. I’ll be trying that myself. Thx.