pixi-tiledmap
pixi-tiledmap copied to clipboard
Error ts2306 : index.d.ts is not a module
Hi,
Thx for the development of pixi-tiledmap... But i'm not able of using it.
Here is my simple code :
_import { Component, OnInit, ElementRef } from '@angular/core'; import { Map } from '../../model/Map.model'; import { MapService } from '../../services/map/map.service'; import { GameService } from '../../services/game/game.service'; import { Application } from 'pixi.js'; import { TiledMap } from 'pixi-tiledmap';
@Component({ selector: 'app-world', templateUrl: './world.component.html', styleUrls: ['./world.component.css'] }) export class WorldComponent implements OnInit {
private map: Map; public app: any;
constructor(private gameService: GameService, private mapService: MapService, private elementRef: ElementRef) { const app = new Application({ width: 800, height: 600 }); this.app = app; this.elementRef.nativeElement.appendChild(app.view);
app.loader
.add('assets/maps/map1.tmx')
.load(function () {
app.renderer.render(new TiledMap('assets/maps/map1.tmx'));
});
}
ngOnInit() {
this.gameService.getGameOnEvent().subscribe(game => {
this.map = game.Map;
});
}
}_
And i got a compilation problem :
error TS2306 : File 'pixi-tiledmap.d.ts' is not a module
And in the console :
core.js:7187 ERROR TypeError: pixi_tiledmap__WEBPACK_IMPORTED_MODULE_4__.TiledMap is not a constructor
I guess I'm doing something wrong but can't know what :(
Would you please help me ?
Quentin
I have exact the same issue. @qmidy, did you solve it?