mercredi 14 septembre 2016

Javascript import error: Super expression must either be null or a function, not undefined

I'm developing an app in javscript using EmberJS. I have developed my own classes but I have the following error when I try to import a child class.

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

This is my source code:

Class A (father):

export class AInput{
  constructor(builder){

        this.user = checkNotNull(builder.user);
        this.itemId = checkNotNull(builder.itemId);

  }
}

export class AInputBuilder {

    constructor(){

    }

        withUser(user) {
          this.user = user;
          return this;
        }

        withItemId(itemId) {
          this.itemId = itemId;
          return this;
        }

    build() {
      return new AInput(this);
    }
}

Class B (child):

import { AInput,
         AInputBuilder } from '../../../item/permission/a/a-input';

export class BInput extends AInput{
  constructor(builder){
    super(builder);
  }
}

export class BInputBuilder extends AInputBuilder {

    constructor(){
      super();
    }

    build() {
      return new BInput(this);
    }
  }

Use:

import { BInputBuilder } from '../../../../../../event/permission/b/b-input';




Aucun commentaire:

Enregistrer un commentaire