Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Traceur runtime: Super expression must either be null or a function, not undefined

Learning ES6 and have run in to the following error straight off Super expression must either be null or a function, not undefined. Really unsure where my problem is, if anyone could help that would be great.

main.js

'use strict'

import Backbone from 'exoskeleton';
import App from './views/App';


var onDOMReady = () => {
    console.log('inside dom ready');
    window.app = new App();
}

if(document.readyState === 'complete' || document.readyState === 'interactive' || document.readyState === 'loaded' ) {
    onDOMReady();
} else {
    document.addEventListener('DOMContentLoaded', onDOMReady);
}

App.js

'use strict'

import Backbone from 'exoskeleton';

class App extends Backbone.View {

    initialize () {
        console.log('App: Init');
    }

    render () {
        console.log('App: Render');
    }

}

export default App;
like image 651
styler Avatar asked Feb 16 '15 22:02

styler


1 Answers

I got this error because I had a circular import structure. One module importing another and the other way around.

like image 142
Lukas Avatar answered Nov 15 '22 21:11

Lukas