Error on npm start -s "missing class properties transform" using ES6 style classes
See original GitHub issueNode version: 6.10.1
npm version: 3.10.10
Operating system: OS X Sierra
Command line used: npm start -s
Steps to reproduce: create an ES6 Class like so, and run npm start -s. An error is produced claiming “missing class properties transform”. This happens for both propTypes, defaultProps, contextTypes and any custom methods/properties I have defined (like _updateDocumentTitle).
class Navigation extends React.Component {
static propTypes = {};
static defaultProps = {};
static contextTypes = {
router: object.isRequired
}
componentDidMount () {
this._updateDocumentTitle();
}
componentDidUpdate () {
this._updateDocumentTitle();
}
_updateDocumentTitle = () => {
// .. do some junk
}
render () {
return (<span>Foo</span>);
}
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Error: Missing class properties transform - Stack Overflow
The fix in my case was defining 'transform-class-properties' plugin in the options attribute of my webpack.config.js, i'm using babel V6
Read more >How to fix Missing class properties transform with react ...
In an existing react project I installed react-soratablejs and it worked fine but later when I pulled the repo in some other place...
Read more >eslint-plugin-jsdoc - npm
Start using eslint-plugin-jsdoc in your project by running `npm i ... of the type(s) such as nodes with certain children or attributes.
Read more >React | WebStorm Documentation - JetBrains
This configuration runs the npm start command that launches the development server and starts your application in the development mode. A ...
Read more >constructor - JavaScript - MDN Web Docs - Mozilla
The constructor method is a special method of a class for creating and initializing an object instance of that class.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have a repo I built out for a local user group that have tests using jest/enzyme, it just lacks a component. It may be of help. https://github.com/NashReact/jest-exercises/tree/master/exercises/13 - Component Testing
Thanks man right up my alley on what I needed!