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() {
	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:


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





Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.