EsotericSoftware / spine-runtimes

2D skeletal animation runtimes for Spine.
http://esotericsoftware.com/
Other
4.42k stars 2.92k forks source link

[ts][phaser] Angular and spine-phaser error #2637

Closed ivmsflash closed 2 months ago

ivmsflash commented 2 months ago

@esotericsoftware/spine-phaser v4.2.59

Error: [TS2688] cannot find type definition file for './phaser'.

Angular Compiler cannot compile the project, a type error occurs on line /// <reference path="./phaser" /> in the *.d.ts files of the module spine-phaser

If this is fixed to /// <reference path="../phaser" />

then it starts working well. Please check this and fix it in future versions.

error

davidetan commented 2 months ago

We just release 4.2.60 that prevent those directives to be inserted into the d.ts files.

However, I tried the latest angular + phaser, and the official phaser-angular template, and in both cases I wasn't able to make this error happens with 4.2.59. Both 4.2.59 and 4.2.60 work to me.

Which Angular version are you using? Are you doing anything special in your project to make this error to appear?

ivmsflash commented 2 months ago

@davidetan Here are the main packages used in the project: "@angular/cli": "^17.1.3", "@angular/common": "^17.1.3", "@angular/compiler": "^17.1.3", "@angular/core": "^17.1.3", "@esotericsoftware/spine-phaser": "4.2.59", "phaser": "3.60.0", "@angular-devkit/build-angular": "^17.1.3", "@angular/compiler-cli": "^17.1.3", "typescript": "^5.3.3",

davidetan commented 2 months ago

Thanks for providing this, but I'm still unable to reproduce your issue using 4.2.59.

Can you try spine-phaser 4.2.60 and report back here if it resolves the issue?

ivmsflash commented 2 months ago

4.2.60 working fine, thank you!