hektor74 Posted December 10, 2017 Share Posted December 10, 2017 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 More sharing options...
PhaserEditor2D Posted January 16, 2018 Share Posted January 16, 2018 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 Fenopiù 1 Link to comment Share on other sites More sharing options...
Recommended Posts