question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error on npm start -s "missing class properties transform" using ES6 style classes

See original GitHub issue

Node 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>);
  }
}

screen shot 2017-03-28 at 11 35 55 am

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
kwelchcommented, Mar 29, 2017

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

1reaction
mikedevitacommented, Mar 29, 2017

Thanks man right up my alley on what I needed!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found