Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error ts2306 : index.d.ts is not a module #13

Open
qmidy opened this issue Jul 18, 2019 · 1 comment
Open

Error ts2306 : index.d.ts is not a module #13

qmidy opened this issue Jul 18, 2019 · 1 comment

Comments

@qmidy
Copy link

qmidy commented Jul 18, 2019

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

@justclimber
Copy link

I have exact the same issue.
@qmidy, did you solve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants