hektor74

Uncaught ReferenceError: exports is not defined

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.

Share this post


Link to post
Share on other sites

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

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.