Troubleshoot deploying cloud functions error with typecasting in node modules

I’m building a reactjs pwa. trying to implement cloud functions in my project.
I’m trying to deploy firebase cloud functions but getting the same error despite trying a couple of things:

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

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

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

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

../node_modules/@types/dom-webcodecs/webcodecs.generated.d.ts:56:14 - error TS2304: Cannot find name 'AvcBitstreamFormat'.

56     format?: AvcBitstreamFormat | undefined;
                ~~~~~~~~~~~~~~~~~~

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

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

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

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

../node_modules/@types/dom-webcodecs/webcodecs.generated.d.ts:74:11 - error TS2552: Cannot find name 'EncodedVideoChunkType'. Did you mean 'EncodedVideoChunk'?

74     type: EncodedVideoChunkType;
             ~~~~~~~~~~~~~~~~~~~~~

  ../node_modules/@types/dom-webcodecs/webcodecs.generated.d.ts:266:13
    266 declare var EncodedVideoChunk: {
                    ~~~~~~~~~~~~~~~~~
    'EncodedVideoChunk' is declared here.

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

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

../node_modules/@types/dom-webcodecs/webcodecs.generated.d.ts:137:13 - error TS2304: Cannot find name 'AlphaOption'.

137     alpha?: AlphaOption | undefined;
                ~~~~~~~~~~~

../node_modules/@types/dom-webcodecs/webcodecs.generated.d.ts:140:19 - error TS2304: Cannot find name 'VideoEncoderBitrateMode'.

140     bitrateMode?: VideoEncoderBitrateMode | undefined;
                      ~~~~~~~~~~~~~~~~~~~~~~~

../node_modules/@types/dom-webcodecs/webcodecs.generated.d.ts:147:19 - error TS2304: Cannot find name 'LatencyMode'.

147     latencyMode?: LatencyMode | undefined;
                      ~~~~~~~~~~~

../node_modules/@types/dom-webcodecs/webcodecs.generated.d.ts:173:13 - error TS2304: Cannot find name 'VideoPixelFormat'.

173     format: VideoPixelFormat;
                ~~~~~~~~~~~~~~~~

../node_modules/@types/dom-webcodecs/webcodecs.generated.d.ts:185:13 - error TS2304: Cannot find name 'AlphaOption'.

185     alpha?: AlphaOption | undefined;
                ~~~~~~~~~~~

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

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

../node_modules/@types/dom-webcodecs/webcodecs.generated.d.ts:214:21 - error TS2304: Cannot find name 'CodecState'.

214     readonly state: CodecState;
                        ~~~~~~~~~~

../node_modules/@types/dom-webcodecs/webcodecs.generated.d.ts:231:21 - error TS2304: Cannot find name 'CodecState'.

231     readonly state: CodecState;
                        ~~~~~~~~~~

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

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

../node_modules/@types/dom-webcodecs/webcodecs.generated.d.ts:262:20 - error TS2304: Cannot find name 'EncodedVideoChunkType'.

262     readonly type: EncodedVideoChunkType;
                       ~~~~~~~~~~~~~~~~~~~~~

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

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

../node_modules/@types/dom-webcodecs/webcodecs.generated.d.ts:329:21 - error TS2304: Cannot find name 'CodecState'.

329     readonly state: CodecState;
                        ~~~~~~~~~~

../node_modules/@types/dom-webcodecs/webcodecs.generated.d.ts:346:21 - error TS2304: Cannot find name 'CodecState'.

346     readonly state: CodecState;
                        ~~~~~~~~~~

../node_modules/@types/dom-webcodecs/webcodecs.generated.d.ts:368:22 - error TS2304: Cannot find name 'VideoPixelFormat'.

368     readonly format: VideoPixelFormat | null;
                         ~~~~~~~~~~~~~~~~

../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[]>;
                            ~~~~~~~~~~~~~~~~~~~~~~~

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

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


Found 23 errors in the same file, starting at: ../node_modules/@types/dom-webcodecs/webcodecs.genera

I have tried:

  • updating packages
  • reinstalling webcodec/ types/dom-webcodecs (getting up to date)
  • Googling around

Don’t know what else to try.