livekit / track-processors-js

Pre-built track processors for background images, blur, etc for use with the LiveKit JS Client SDK
https://livekit.io
Apache License 2.0
31 stars 14 forks source link

Unknown object type error #14

Open marcelgoya opened 1 year ago

marcelgoya commented 1 year ago

Hello,

I am trying to run this plugin with our LiveKit app. Unfortunately, I am getting some weird unknown object type error messages.

Below the console output:


Error: node_modules/@types/dom-webcodecs/webcodecs.generated.d.ts:13:11 - error TS2304: Cannot find name 'AllowSharedBufferSource'.

13     data: AllowSharedBufferSource;
             ~~~~~~~~~~~~~~~~~~~~~~~

Error: node_modules/@types/dom-webcodecs/webcodecs.generated.d.ts:23:19 - error TS2304: Cannot find name 'AllowSharedBufferSource'.

23     description?: AllowSharedBufferSource | undefined;
                     ~~~~~~~~~~~~~~~~~~~~~~~

Error: node_modules/@types/dom-webcodecs/webcodecs.generated.d.ts:60:11 - error TS2304: Cannot find name 'AllowSharedBufferSource'.

60     data: AllowSharedBufferSource;
             ~~~~~~~~~~~~~~~~~~~~~~~

Error: node_modules/@types/dom-webcodecs/webcodecs.generated.d.ts:71:11 - error TS2304: Cannot find name 'AllowSharedBufferSource'.

71     data: AllowSharedBufferSource;
             ~~~~~~~~~~~~~~~~~~~~~~~

Error: node_modules/@types/dom-webcodecs/webcodecs.generated.d.ts:119:5 - error TS2717: Subsequent property declarations must have the same type.  Property 'description' must be of type 'BufferSource', but here has type 'any'.

119     description?: AllowSharedBufferSource | undefined;
        ~~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:2000:5
    2000     description?: BufferSource;
             ~~~~~~~~~~~
    'description' was also declared here.

Error: node_modules/@types/dom-webcodecs/webcodecs.generated.d.ts:119:19 - error TS2304: Cannot find name 'AllowSharedBufferSource'.

119     description?: AllowSharedBufferSource | undefined;
                      ~~~~~~~~~~~~~~~~~~~~~~~

Error: node_modules/@types/dom-webcodecs/webcodecs.generated.d.ts:203:25 - error TS2304: Cannot find name 'AllowSharedBufferSource'.

203     copyTo(destination: AllowSharedBufferSource, options: AudioDataCopyToOptions): void;
                            ~~~~~~~~~~~~~~~~~~~~~~~

Error: node_modules/@types/dom-webcodecs/webcodecs.generated.d.ts:250:25 - error TS2304: Cannot find name 'AllowSharedBufferSource'.

250     copyTo(destination: AllowSharedBufferSource): void;
                            ~~~~~~~~~~~~~~~~~~~~~~~

Error: node_modules/@types/dom-webcodecs/webcodecs.generated.d.ts:263:25 - error TS2304: Cannot find name 'AllowSharedBufferSource'.

263     copyTo(destination: AllowSharedBufferSource): void;
                            ~~~~~~~~~~~~~~~~~~~~~~~

Error: node_modules/@types/dom-webcodecs/webcodecs.generated.d.ts:374:25 - error TS2304: Cannot find name 'AllowSharedBufferSource'.

374     copyTo(destination: AllowSharedBufferSource, options?: VideoFrameCopyToOptions): Promise<PlaneLayout[]>;
                            ~~~~~~~~~~~~~~~~~~~~~~~

Error: node_modules/@types/dom-webcodecs/webcodecs.generated.d.ts:377:13 - error TS2403: Subsequent variable declarations must have the same type.  Variable 'VideoFrame' must be of type '{ new (image: CanvasImageSource, init?: VideoFrameInit): VideoFrame; new (data: BufferSource, init: VideoFrameBufferInit): VideoFrame; prototype: VideoFrame; }', but here has type '{ new (source: CanvasImageSource, init?: VideoFrameInit): VideoFrame; new (data: AllowSharedBufferSource, init: VideoFrameBufferInit): VideoFrame; prototype: VideoFrame; }'.

377 declare var VideoFrame: {
                ~~~~~~~~~~

  node_modules/typescript/lib/lib.dom.d.ts:22771:13
    22771 declare var VideoFrame: {
                      ~~~~~~~~~~
    'VideoFrame' was also declared here.

Error: node_modules/@types/dom-webcodecs/webcodecs.generated.d.ts:380:15 - error TS2304: Cannot find name 'AllowSharedBufferSource'.

380     new(data: AllowSharedBufferSource, init: VideoFrameBufferInit): VideoFrame;
                  ~~~~~~~~~~~~~~~~~~~~~~~

Any help or pointing me into the right direction would be greatly appreciated.

Thanks, Marcel

lukasIO commented 1 year ago

what typescript version are you using? How are you installing the plugin and which bundler are you using?

marcelgoya commented 1 year ago

I am using typescript version 5.1.6 and I am running it via

npm i @track-processors-js

because I am not using yarn. It's an angular/ionic project and it is using webpack.

marcelgoya commented 1 year ago

I've just created an app with the Ionic cli from scratch and simply added the plugin via npm and yarn but the error messages keep appearing.

lukasIO commented 1 year ago

It definitely looks like something is complaining about a mismatch of type definitions (or the lack thereof). Is there anything else in the console output? Does it work as expected for you on a vanilla-ts project?

marcelgoya commented 1 year ago

I was using a vanilla Ionic template and it produced the same result.

lukasIO commented 1 year ago

without ionic, I mean!