Closed uahic closed 5 years ago
Hi!
I'm running into the same issue, did you find a workaround?
I'm not super familiar with typescript definition files. @ertrzyiks or @macropp, can you help with this one?
Hey, I saw you're importing Pixi as import * as PIXI from 'pixi.js/dist/pixi.js';
, can you try import * as PIXI from "pixi.js";
?
Importing pixi.js file from dist folder actually imports javascript file, so Typescript service doesn't get a chance to have a look if the module provides type definitions. I'd strongly suggest you never import specific files from npm modules, instead try to import modules or named exports.
Pixi breaks if you import with import * as PIXI from "pixi.js";
see issue
Seems like it's Angular 6 build that breaks. Not sure how to resolve the issue, if you have suggestions, they're welcome :)
With Angular 7 I get the same error even with just "import * as PIXI from 'pixi.js'" The app itself works fine, though. I don't suppose there's any way to just suppress the errors? Is there documentation/examples anywhere about best ways to use this with angular/webpack?
You may have a look at my library https://github.com/uahic/ng-pixi . I had the same problems, somehow I managed to go around :) take a look at the package.json
You need for example "@types/pixi.js": "^4.8.1", ( npm install --save @types/pixi.js@4.8.1) But then there will be an issue in the index.d.ts of either pixi or pixi-viewport (cant remember), just modify the line where it will complain from PIXI.ticker.Ticker to PIXI.Ticker and you'll be fine
thanks for the fix @uahic , I didn't run into any issues with Ticker yet (probably because my application doesn't use it yet). I did get this error:
ERROR in src/app/pages/fsli-work-page/evidence-modal/evidence-modal.component.ts(39,30): error TS2339: Property 'interaction' does not exist on type 'WebGLRenderer | CanvasRenderer'. Property 'interaction' does not exist on type 'WebGLRenderer'.
But typecasting app.renderer to :any took care of that error.
Feel free to reopen if this is still an issue.
Hi there,
first of all: thank you for your effort in this project! I work with Angular >6 and Pixi 4.8.1. It seems that the typescript definitions of pixi-viewport do not recognize the namespace of PIXI
node_modules/pixi-viewport/@types/index.d.ts(47,9): error TS2503: Cannot find namespace 'PIXI'
I manually inserted an import of PIXI into the definition file, however, I dont know if there are other mechanism that are expected to do that already