Jump to content

Uncaught ReferenceError: exports is not defined


hektor74
 Share

Recommended Posts

Hi to everyone here,

I'm new at phaser editor. I code in Typescript. I want to create a class and import it in level.ts. Bu I got "Uncaught ReferenceError: exports is not defined" message at browser's console. My code is this:

///<reference path="ShapeControllerHTMLV1.ts" />
// -- user code here --

/* --- start generated code --- */

// Generated by Phaser Editor 1.4.3 (Phaser v2.6.2)


/**
 * Level.
 */
import { shapeController } from "./ShapeControllerHTMLV1";

class Level extends Phaser.State {
	
	constructor() {
		
		super();
		
	}
	
	init() {
		
		this.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL;
		this.scale.pageAlignHorizontally = true;
		this.scale.pageAlignVertically = true;
		
	}
	
	preload () {
		
		this.load.pack('section0', 'assets/pack.json');
		
	}
	
	create() {
	    var a = new shapeController.Greeter(this.game, 10, 10, 'blabla');
		
	}
}

And this is my class:

export namespace shapeController{
    export class Greeter extends Phaser.Sprite{
        constructor(gm:Phaser.Game, _x:number, _y:number, _name:string){
            super(gm, _x, _y, _name);
        }
    }    
}

Thanks in advance.

Link to comment
Share on other sites

  • 1 month later...

Hi @hektor74

I just saw this comment yesterday while googling for the same problem.

Please look this issue in the Phaser Editor repo:

https://github.com/PhaserEditor2D/PhaserEditor/issues/67#issuecomment-357732936

Next time you can add issues there or mention @PhaserEditor2D here to get a notification.

 

Regards

Arian

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...