I am using ReactJS.
When I run the code below the browser says:
Uncaught TypeError: Super expression must either be null or a function, not undefined
Any hints at all as to what is wrong would be appreciated.
First the line used to compile the code:
browserify -t reactify -t babelify examples/temp.jsx -o examples/public/app.js
And the code:
var React = require('react');
class HelloMessage extends React.Component {
render() {
return <div>Hello </div>;
}
}
UPDATE: After burning in hellfire for three days on this problem I found that I was not using the latest version of react.
Install globally:
sudo npm install -g [email protected]
install locally:
npm install [email protected]
make sure the browser is using the right version too:
<script type="text/javascript" src="react-0.13.2.js"></script>
Hope this saves someone else three days of precious life.
extends React.component
(lowercasec
). – KinesicsComponents
instead ofComponent
:). Your comment helped BTW – Foolhardyimport Relay, { Mutation } from 'react-relay';
instead of intendedimport Relay, { Mutation } from 'react-relay/classic';
– Lesleylesliexport default class SideNav extends React.Component() {...}
Corrected to the following and all was fine:export default class SideNav extends React.Component {...}
– Martensiteindex.js
and it defines B then A as exports but B extends A, then this will also throw this error as B is created before A is available either reference the actual file or ensure your index is in the order of requirements – Scrotum