pixi-viewport
pixi-viewport copied to clipboard
Unable to add Viewport to Stage (TS Type Definition)
When trying to add PIXI Viewport to an applications stage when using typescript. It seems like it's very similar to the error in #348 which is
src/engine.ts:124:41 - error TS2345: Argument of type 'Viewport' is not assignable to parameter of type 'DisplayObject'.
Property '_maskRefCount' is missing in type 'Viewport' but required in type 'DisplayObject'.
124 this.Application.stage.addChild(this.Viewport)
The dependencies used are;
"dependencies": {
"events": "^3.3.0",
"pixi-viewport": "^4.34.4",
"pixi.js": "^6.2.2"
},
"devDependencies": {
"@types/events": "^3.0.0",
"@types/offscreencanvas": "^2019.6.4",
"typescript": "^4.6.4"
}
The code can be found at eplengine/tree/pixi-viewport.
@ktwrd I had this issue, and it was because my Pixi dependencies were not updating properly. For me, in node modules there was pixi.js and @pixi. Look at the package.json files in pixi.js and @pixi/core and make sure the versions are what you are expecting.
@ktwrd Did you get this resolved?
May I ask what target version of pixi.js is the current release (4.35.0)? I am also getting this error and I'm trying to trackdown all the correct dependencies.
Currently I have
{
"dependencies":
"@pixi/filter-adjustment": "^4.2.0",
"@pixi/filter-glow": "^4.2.0",
"@pixi/filter-multi-color-replace": "^4.2.0",
"pixi-viewport": "^4.35.0",
"pixi.js": "^6.5.1",
}
@kurtwaldowski-echelon Sorry for the late response, yes this did fix the problem. Thank you very much!! <3