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

Runtime 4.1 does not play nice with TypeScript strict mode #543

Open
qtiki opened this issue Feb 1, 2024 · 2 comments
Open

Runtime 4.1 does not play nice with TypeScript strict mode #543

qtiki opened this issue Feb 1, 2024 · 2 comments

Comments

@qtiki
Copy link

qtiki commented Feb 1, 2024

Trying to use the runtime 4.1 with strict: enabled causes a bunch of errors like this:

node_modules/@pixi-spine/runtime-4.1/index.d.ts:78:64 - error TS2344: Type 'AnimationStateData' does not satisfy the constraint 'IAnimationStateData<ISkeletonData<IBoneData, ISlotData, ISkin, IAnimation<ITimeline>, IEventData, IIkConstraintData, ITransformConstraintData, IPathConstraintData>, IAnimation<...>>'.
  The types of 'skeletonData.name' are incompatible between these types.
    Type 'string | null' is not assignable to type 'string'.
      Type 'null' is not assignable to type 'string'.

78 export declare class AnimationState implements IAnimationState<AnimationStateData> {
                                                                  ~~~~~~~~~~~~~~~~~~

Older runtimes 4.0 and 3.8 compile correctly even with the strict mode.

@qtiki
Copy link
Author

qtiki commented Feb 1, 2024

Easiest way to reproduce/fix these issues is to enable strictNullChecks: true in the project's tsconfig.json. That'll throw a bunch of compile errors.

Though looking at the core Pixi.js repository it doesn't seem to have strict null checks enabled either. It would be great if these packages would be fully strict mode compliant.

@qtiki
Copy link
Author

qtiki commented Feb 1, 2024

Okay seems like there is already an issue about this for Pixi itself: pixijs/pixijs#8852

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

1 participant