cachopixi Posted May 5, 2019 Share Posted May 5, 2019 Hi there, When tying to compile pixi.js 5 with typescript I get node_modules/pixi.js/pixi.js.d.ts(3848,30): error TS2304: Cannot find name 'WEBGL_draw_buffers'. 3848 drawBuffers: WEBGL_draw_buffers; ~~~~~~~~~~~~~~~~~~ node_modules/pixi.js/pixi.js.d.ts(3851,30): error TS2304: Cannot find name 'WEBGL_lose_context'. 3851 loseContext: WEBGL_lose_context; ~~~~~~~~~~~~~~~~~~ node_modules/pixi.js/pixi.js.d.ts(3852,36): error TS2304: Cannot find name 'OES_vertex_array_object'. 3852 vertexArrayObject: OES_vertex_array_object; ~~~~~~~~~~~~~~~~~~~~~~~ the definitions of those symbols are on lib.dom.d.ts so I'm not sure what should I do Thanks! Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted May 5, 2019 Share Posted May 5, 2019 Need ES6 or something like that in the libs., I dont remember exactly. Workaround: If you dont use webpack and other things you can just copy that file to your libRoot or somewhere in your project and remove those lines. Maybe we'll remove them from typings so people dont have that problem. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted May 5, 2019 Share Posted May 5, 2019 That's how pixi-spine works: https://github.com/pixijs/pixi-spine/blob/master/tsconfig.json#L13 Quote Link to comment Share on other sites More sharing options...
cachopixi Posted May 5, 2019 Author Share Posted May 5, 2019 Dude, you're amazing. You always reply right away! > Need ES6 or something like that in the libs., I dont remember exactly. I trid that, no luck > Workaround: If you dont use webpack and other things you can just copy that file to your libRoot or somewhere in your project and remove those lines. Unfortunatelly I do use webpack > That's how pixi-spine works: https://github.com/pixijs/pixi-spine/blob/master/tsconfig.json#L13 I tried the different parameters in that tsconfig.json without sucess. So I'm likely missing something. Anyway, I solved it by removing those 3 lines out of pixi.js.d.ts Now I'll spend some time porting the existing code Very excited to finally try 5.0! Cheers ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
botmaster Posted May 6, 2019 Share Posted May 6, 2019 This can also happen depending on the typescript version you are using, especially if it's the latest one. Start with lower version and see if that fix that problem then increase until you get those errors again. Also an easy fix is to supply those missing types your self with an empty class or interface. ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted May 6, 2019 Share Posted May 6, 2019 5.0.1 release just landed, please take it instead of 5.0.0. And @botmaster knows TS tricks ^^^ Quote Link to comment Share on other sites More sharing options...
botmaster Posted May 6, 2019 Share Posted May 6, 2019 Can we get a WebGLRenderingContext and a WebGL2RenderingContext in one type? Sure np! export interface GPURenderingContext extends WebGLRenderingContext { createVertexArray():WebGLVertexArrayObjectOES; drawArraysInstanced(mode:number, first:number, count:number, instanceCount:number):void; drawElementsInstanced(mode:number, count:number, type:number, offset:number, instanceCount:number):void; vertexAttribDivisor(index:number, divisor:number):void; deleteVertexArray(vertexArray:WebGLVertexArrayObjectOES):void; bindVertexArray(vertexArray:WebGLVertexArrayObjectOES):void; pixelStorei(pname:number, param:number|boolean):void; drawBuffers(buffers:number[]):void; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.