pixijs / pixijs

The HTML5 Creation Engine: Create beautiful digital content with the fastest, most flexible 2D WebGL renderer.
http://pixijs.com
MIT License
43.18k stars 4.74k forks source link

Bug: Tutorial code doesn't compile in TypeScript and PixiJS 7.3.2 #9842

Closed martinsik closed 7 months ago

martinsik commented 8 months ago

Current Behavior

I took the code example from the tutorial and I'm trying to compile it in TypeScript with the latest PIXI.JS and TypeScript versions. It throws errors:

[1] node_modules/@types/css-font-loading-module/index.d.ts(22,9): error TS2717: Subsequent property declarations must have the same type.  Property 'display' must be of type 'FontDisplay', but here has type 'string'.
[1] node_modules/@types/css-font-loading-module/index.d.ts(42,9): error TS2717: Subsequent property declarations must have the same type.  Property 'display' must be of type 'FontDisplay', but here has type 'string'.

https://github.com/martinsik/pixijs-7-typescript/blob/main/src/lib/index.ts

Expected Behavior

It should compile without any errors.

Steps to Reproduce

$ git clone https://github.com/martinsik/pixijs-7-typescript/
$ cd pixijs-7-typescript
$ npm ci
$ npm run serve

This will start concurrently a development server and TypeScript compiler in watch mode.

Environment

Possible Solution

No response

Additional Information

No response

martinsik commented 8 months ago

Looks like hardcoding @types/css-font-loading-module version helped and now it compiles with the latest TypeScript and PixiJS versions:

"@types/css-font-loading-module": "0.0.10"
bigtimebuddy commented 8 months ago

Thanks for letting us know. I'm working on resolving this.

avpeery commented 7 months ago

@bigtimebuddy Any update on this fix? Just ran into the same issue in a different project. Thanks

bigtimebuddy commented 7 months ago

@avpeery I started on this task, but was quickly blocked by TypeScript being out of date in the project. I needed to update one of our dependencies. I'll give this another shot and will try to get it in the next 7.3.3 release.

avpeery commented 7 months ago

Many thanks @bigtimebuddy for addressing and fixing it quickly!! Will it be in 7.3.3?