Skip to content
This repository has been archived by the owner on Jun 28, 2021. It is now read-only.

Cannot run npm run build #10

Closed
tleunen opened this issue Dec 20, 2016 · 3 comments
Closed

Cannot run npm run build #10

tleunen opened this issue Dec 20, 2016 · 3 comments
Labels

Comments

@tleunen
Copy link
Owner

tleunen commented Dec 20, 2016

@bluepichu I've never really used typescript before. Could you explain what's missing for me to run npm run build?

I'm currently getting a lot of errors like these:

pixi-multistyle-text.ts(3,37): error TS2503: Cannot find namespace 'PIXI'.
pixi-multistyle-text.ts(3,37): error TS4022: Extends clause of exported interface 'ExtendedTextStyle' has or is using private name 'PIXI'.
pixi-multistyle-text.ts(36,30): error TS2304: Cannot find name 'PIXI'.
pixi-multistyle-text.ts(36,30): error TS4020: Extends clause of exported class 'MultiStyleText' has or is using private name 'PIXI'.
pixi-multistyle-text.ts(49,4): error TS2322: Type '{ align: string; breakWords: boolean; dropShadow: boolean; dropShadowAngle: number; dropShadowBlu...' is not assignable to type 'ExtendedTextStyle'.
  Object literal may only specify known properties, and 'align' does not exist in type 'ExtendedTextStyle'.

Also, we should add typescript as a dev dependency.

@bluepichu
Copy link
Collaborator

bluepichu commented Dec 20, 2016

Agreed regarding adding typescript as a dev dependency - I tend to forget about that since it's a global install.

Those errors look like you're missing the pixi.js type definitions, which likely means one of two things:

  • You need to run npm install to get the type definitions for Pixi, which get installed as @types/pixi.js.
  • You're using an older version of TypeScript (pre-2.0), which doesn't automatically import @types definitions. Updating to a newer version (I think the current one is 2.1.4) should fix the problem.

Let me know if neither of those work.

@tleunen
Copy link
Owner Author

tleunen commented Dec 23, 2016

Thanks @bluepichu, my bad, forgot to install the types ^^ Still having these errors:

pixi-multistyle-text.ts(260,5): error TS2322: Type 'string | number' is not assignable to type 'string | CanvasGradient | CanvasPattern'.
  Type 'number' is not assignable to type 'string | CanvasGradient | CanvasPattern'.
pixi-multistyle-text.ts(283,6): error TS2322: Type 'string | number' is not assignable to type 'string | CanvasGradient | CanvasPattern'.
  Type 'number' is not assignable to type 'string | CanvasGradient | CanvasPattern'.
pixi-multistyle-text.ts(294,5): error TS2322: Type 'string | number | string[] | number[] | CanvasGradient | CanvasPattern' is not assignable to type 'string | CanvasGradient | CanvasPattern'.
  Type 'number' is not assignable to type 'string | CanvasGradient | CanvasPattern'.

@bluepichu
Copy link
Collaborator

#14 should fix these.

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

No branches or pull requests

2 participants