livekit / client-sdk-js

LiveKit browser client SDK (javascript)
https://livekit.io
Apache License 2.0
337 stars 146 forks source link

Angular 10 Compatibility Issue #1003

Open harisnewbie opened 8 months ago

harisnewbie commented 8 months ago

Describe the bug After importing the Livekit Client in a component, the angular app won't start. It seems to be a compatibility issue.

Server

Client

To Reproduce Steps to reproduce the behavior:

  1. Create a Angular 10 app using Angular CLI npx -p @angular/cli@10.2.3 ng new angular10App
  2. Install "livekit-client" npm install livekit-client --save
  3. Import Room from "livekit-client" in a component import { Room } from 'livekit-client';

Additional Context I am switching over from Twilio to Livekit. The project is too large and it would require updating the app to at least 5 major versions to meet the required typescript version. It would be great if the client SDK was backwards compatible.

Log

ERROR in node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:88:19 - error TS1005: ']' expected.

88     [P in keyof T as T[P] extends Function ? never : P]: PlainField<T[P]>;
                     ~~
node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:88:22 - error TS1005: ';' expected.

88     [P in keyof T as T[P] extends Function ? never : P]: PlainField<T[P]>;
                        ~
node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:88:27 - error TS1005: ';' expected.

88     [P in keyof T as T[P] extends Function ? never : P]: PlainField<T[P]>;
                             ~~~~~~~
node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:88:55 - error TS1005: ';' expected.

88     [P in keyof T as T[P] extends Function ? never : P]: PlainField<T[P]>;
                                                         ~
node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:88:56 - error TS1128: Declaration or statement expected.

88     [P in keyof T as T[P] extends Function ? never : P]: PlainField<T[P]>;
                                                          ~
node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:88:74 - error TS1005: '(' expected.

88     [P in keyof T as T[P] extends Function ? never : P]: PlainField<T[P]>;
                                                                            ~
node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:89:1 - error TS1128: Declaration or statement expected.

89 };
   ~
node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:113:19 - error TS1005: ']' expected.

113     [P in keyof T as T[P] extends Function ? never : P]?: PartialField<T[P]>;
                      ~~
node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:113:22 - error TS1005: ';' expected.

113     [P in keyof T as T[P] extends Function ? never : P]?: PartialField<T[P]>;
                         ~
node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:113:27 - error TS1005: ';' expected.

113     [P in keyof T as T[P] extends Function ? never : P]?: PartialField<T[P]>;
                              ~~~~~~~
node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:113:55 - error TS1005: ';' expected.

113     [P in keyof T as T[P] extends Function ? never : P]?: PartialField<T[P]>;
                                                          ~
node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:113:56 - error TS1128: Declaration or statement expected.

113     [P in keyof T as T[P] extends Function ? never : P]?: PartialField<T[P]>;
                                                           ~
node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:113:57 - error TS1128: Declaration or statement expected.

113     [P in keyof T as T[P] extends Function ? never : P]?: PartialField<T[P]>;
                                                            ~
node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:113:77 - error TS1005: '(' expected.

113     [P in keyof T as T[P] extends Function ? never : P]?: PartialField<T[P]>;
                                                                                ~
node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:114:1 - error TS1128: Declaration or statement expected.

114 };
    ~
node_modules/livekit-client/dist/src/e2ee/KeyProvider.d.ts:2:15 - error TS1005: ',' expected.

2 import { type KeyProviderCallbacks } from './events';
                ~~~~~~~~~~~~~~~~~~~~
node_modules/livekit-client/dist/src/room/RTCEngine.d.ts:6:15 - error TS1005: ',' expected.

6 import { type AddTrackRequest, type ConnectionQualityUpdate, type JoinResponse, type StreamStateUpdate, SubscribedQualityUpdate, type SubscriptionPermissionUpdate, type SubscriptionResponse, TrackUnpublishedResponse } from '../proto/livekit_rtc_pb';
                ~~~~~~~~~~~~~~~
node_modules/livekit-client/dist/src/room/RTCEngine.d.ts:6:37 - error TS1005: ',' expected.

6 import { type AddTrackRequest, type ConnectionQualityUpdate, type JoinResponse, type StreamStateUpdate, SubscribedQualityUpdate, type SubscriptionPermissionUpdate, type SubscriptionResponse, TrackUnpublishedResponse } from '../proto/livekit_rtc_pb';
                                      ~~~~~~~~~~~~~~~~~~~~~~~
node_modules/livekit-client/dist/src/room/RTCEngine.d.ts:6:67 - error TS1005: ',' expected.

6 import { type AddTrackRequest, type ConnectionQualityUpdate, type JoinResponse, type StreamStateUpdate, SubscribedQualityUpdate, type SubscriptionPermissionUpdate, type SubscriptionResponse, TrackUnpublishedResponse } from '../proto/livekit_rtc_pb';
                                                                    ~~~~~~~~~~~~
node_modules/livekit-client/dist/src/room/RTCEngine.d.ts:93m6:86 - error TS1005: ',' expected.

6 import { type AddTrackRequest, type ConnectionQualityUpdate, type JoinResponse, type StreamStateUpdate, SubscribedQualityUpdate, type SubscriptionPermissionUpdate, type SubscriptionResponse, TrackUnpublishedResponse } from '../proto/livekit_rtc_pb';
                                                                                       ~~~~~~~~~~~~~~~~~
node_modules/livekit-client/dist/src/room/RTCEngine.d.ts:6:135 - error TS1005: ',' expected.

6 import { type AddTrackRequest, type ConnectionQualityUpdate, type JoinResponse, type StreamStateUpdate, SubscribedQualityUpdate, type SubscriptionPermissionUpdate, type SubscriptionResponse, TrackUnpublishedResponse } from '../proto/livekit_rtc_pb';
                                                                                                                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/livekit-client/dist/src/room/RTCEngine.d.ts:6:170 - error TS1005: ',' expected.

6 import { type AddTrackRequest, type ConnectionQualityUpdate, type JoinResponse, type StreamStateUpdate, SubscribedQualityUpdate, type SubscriptionPermissionUpdate, type SubscriptionResponse, TrackUnpublishedResponse } from '../proto/livekit_rtc_pb';
                                                                                                                                                                           ~~~~~~~~~~~~~~~~~~~~

** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **

Date: 2024-01-24T01:49:34.277Z - Hash: 326fc5b9e9ecccc01c48
6 unchanged chunks

Time: 968ms

WARNING in ./src/styles.css (./node_modules/css-loader/dist/cjs.js??ref--12-1!./node_modules/postcss-loader/src??embedded!./src/styles.css)
Module Warning (from ./node_modules/postcss-loader/src/index.js):
Warning

(1329:3) end value has mixed support, consider using flex-end instead

ERROR in node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:88:19 - error TS1005: ']' expected.

88     [P in keyof T as T[P] extends Function ? never : P]: PlainField<T[P]>;
                     ~~
node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:88:22 - error TS1005: ';' expected.

88     [P in keyof T as T[P] extends Function ? never : P]: PlainField<T[P]>;
                        ~
node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:88:27 - error TS1005: ';' expected.

88     [P in keyof T as T[P] extends Function ? never : P]: PlainField<T[P]>;
                             ~~~~~~~
node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:88:55 - error TS1005: ';' expected.

88     [P in keyof T as T[P] extends Function ? never : P]: PlainField<T[P]>;
                                                         ~
node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:88:56 - error TS1128: Declaration or statement expected.

88     [P in keyof T as T[P] extends Function ? never : P]: PlainField<T[P]>;
                                                          ~
node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:88:74 - error TS1005: '(' expected.

88     [P in keyof T as T[P] extends Function ? never : P]: PlainField<T[P]>;
                                                                            ~
node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:89:1 - error TS1128: Declaration or statement expected.

89 };
   ~
node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:113:19 - error TS1005: ']' expected.

113     [P in keyof T as T[P] extends Function ? never : P]?: PartialField<T[P]>;
                      ~~
node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:113:22 - error TS1005: ';' expected.

113     [P in keyof T as T[P] extends Function ? never : P]?: PartialField<T[P]>;
                         ~
node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:113:27 - error TS1005: ';' expected.

113     [P in keyof T as T[P] extends Function ? never : P]?: PartialField<T[P]>;
                              ~~~~~~~
node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:113:55 - error TS1005: ';' expected.

113     [P in keyof T as T[P] extends Function ? never : P]?: PartialField<T[P]>;
                                                          ~
node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:113:56 - error TS1128: Declaration or statement expected.

113     [P in keyof T as T[P] extends Function ? never : P]?: PartialField<T[P]>;
                                                           ~
node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:113:57 - error TS1128: Declaration or statement expected.

113     [P in keyof T as T[P] extends Function ? never : P]?: PartialField<T[P]>;
                                                            ~
node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:113:77 - error TS1005: '(' expected.

113     [P in keyof T as T[P] extends Function ? never : P]?: PartialField<T[P]>;
                                                                                ~
node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:114:1 - error TS1128: Declaration or statement expected.

114 };
    ~
node_modules/livekit-client/dist/src/e2ee/KeyProvider.d.ts:2:15 - error TS1005: ',' expected.

2 import { type KeyProviderCallbacks } from './events';
                ~~~~~~~~~~~~~~~~~~~~
node_modules/livekit-client/dist/src/room/RTCEngine.d.ts:6:15 - error TS1005: ',' expected.

6 import { type AddTrackRequest, type ConnectionQualityUpdate, type JoinResponse, type StreamStateUpdate, SubscribedQualityUpdate, type SubscriptionPermissionUpdate, type SubscriptionResponse, TrackUnpublishedResponse } from '../proto/livekit_rtc_pb';
                ~~~~~~~~~~~~~~~
node_modules/livekit-client/dist/src/room/RTCEngine.d.ts:6:37 - error TS1005: ',' expected.

6 import { type AddTrackRequest, type ConnectionQualityUpdate, type JoinResponse, type StreamStateUpdate, SubscribedQualityUpdate, type SubscriptionPermissionUpdate, type SubscriptionResponse, TrackUnpublishedResponse } from '../proto/livekit_rtc_pb';
                                      ~~~~~~~~~~~~~~~~~~~~~~~
node_modules/livekit-client/dist/src/room/RTCEngine.d.ts:6:67 - error TS1005: ',' expected.

6 import { type AddTrackRequest, type ConnectionQualityUpdate, type JoinResponse, type StreamStateUpdate, SubscribedQualityUpdate, type SubscriptionPermissionUpdate, type SubscriptionResponse, TrackUnpublishedResponse } from '../proto/livekit_rtc_pb';
                                                                    ~~~~~~~~~~~~
node_modules/livekit-client/dist/src/room/RTCEngine.d.ts:93m6:86 - error TS1005: ',' expected.

6 import { type AddTrackRequest, type ConnectionQualityUpdate, type JoinResponse, type StreamStateUpdate, SubscribedQualityUpdate, type SubscriptionPermissionUpdate, type SubscriptionResponse, TrackUnpublishedResponse } from '../proto/livekit_rtc_pb';
                                                                                       ~~~~~~~~~~~~~~~~~
node_modules/livekit-client/dist/src/room/RTCEngine.d.ts:6:135 - error TS1005: ',' expected.

6 import { type AddTrackRequest, type ConnectionQualityUpdate, type JoinResponse, type StreamStateUpdate, SubscribedQualityUpdate, type SubscriptionPermissionUpdate, type SubscriptionResponse, TrackUnpublishedResponse } from '../proto/livekit_rtc_pb';
                                                                                                                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/livekit-client/dist/src/room/RTCEngine.d.ts:6:170 - error TS1005: ',' expected.

6 import { type AddTrackRequest, type ConnectionQualityUpdate, type JoinResponse, type StreamStateUpdate, SubscribedQualityUpdate, type SubscriptionPermissionUpdate, type SubscriptionResponse, TrackUnpublishedResponse } from '../proto/livekit_rtc_pb';
                                                                                                                                                                           ~~~~~~~~~~~~~~~~~~~~

    ERROR in node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:88:19 - error TS2304: Cannot find name 'as'.

    88     [P in keyof T as T[P] extends Function ? never : P]: PlainField<T[P]>;
                         ~~
    node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:88:22 - error TS2304: Cannot find name 'T'.

    88     [P in keyof T as T[P] extends Function ? never : P]: PlainField<T[P]>;
                            ~
    node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:88:24 - error TS2304: Cannot find name 'P'.

    88     [P in keyof T as T[P] extends Function ? never : P]: PlainField<T[P]>;
                              ~
    node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:88:46 - error TS2693: 'never' only refers to a type, but is being used as a value here.

    88     [P in keyof T as T[P] extends Function ? never : P]: PlainField<T[P]>;
                                                    ~~~~~
    node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:88:54 - error TS2304: Cannot find name 'P'.

    88     [P in keyof T as T[P] extends Function ? never : P]: PlainField<T[P]>;
                                                            ~
    node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:88:58 - error TS2693: 'PlainField' only refers to a type, but is being used as a value here.

    88     [P in keyof T as T[P] extends Function ? never : P]: PlainField<T[P]>;
                                                                ~~~~~~~~~~
    node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:88:69 - error TS2304: Cannot find name 'T'.

    88     [P in keyof T as T[P] extends Function ? never : P]: PlainField<T[P]>;
                                                                           ~
    node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:88:71 - error TS2304: Cannot find name 'P'.

    88     [P in keyof T as T[P] extends Function ? never : P]: PlainField<T[P]>;
                                                                             ~
    node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:113:19 - error TS2304: Cannot find name 'as'.

    113     [P in keyof T as T[P] extends Function ? never : P]?: PartialField<T[P]>;
                          ~~
    node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:113:22 - error TS2304: Cannot find name 'T'.

    113     [P in keyof T as T[P] extends Function ? never : P]?: PartialField<T[P]>;
                             ~
    node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:113:24 - error TS2304: Cannot find name 'P'.

    113     [P in keyof T as T[P] extends Function ? never : P]?: PartialField<T[P]>;
                               ~
    node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:113:46 - error TS2693: 'never' only refers to a type, but is being used as a value here.

    113     [P in keyof T as T[P] extends Function ? never : P]?: PartialField<T[P]>;
                                                     ~~~~~
    node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:113:54 - error TS2304: Cannot find name 'P'.

    113     [P in keyof T as T[P] extends Function ? never : P]?: PartialField<T[P]>;
                                                             ~
    node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:113:59 - error TS2693: 'PartialField' only refers to a type, but is being used as a value here.

    113     [P in keyof T as T[P] extends Function ? never : P]?: PartialField<T[P]>;
                                                                  ~~~~~~~~~~~~
    node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:113:72 - error TS2304: Cannot find name 'T'.

    113     [P in keyof T as T[P] extends Function ? never : P]?: PartialField<T[P]>;
                                                                               ~
    node_modules/@bufbuild/protobuf/dist/cjs/message.d.ts:113:74 - error TS2304: Cannot find name 'P'.

    113     [P in keyof T as T[P] extends Function ? never : P]?: PartialField<T[P]>;
                                                                                 ~
    node_modules/livekit-client/dist/src/room/utils.d.ts:31:47 - error TS2304: Cannot find name 'ResizeObserver'.

    31 export declare const getResizeObserver: () => ResizeObserver;
                                                     ~~~~~~~~~~~~~~
    node_modules/livekit-client/dist/src/room/utils.d.ts:34:27 - error TS2304: Cannot find name 'ResizeObserverEntry'.

    34     handleResize: (entry: ResizeObserverEntry) => void;
                                 ~~~~~~~~~~~~~~~~~~~
    node_modules/livekit-client/dist/src/e2ee/KeyProvider.d.ts:2:10 - error TS2305: Module '"./events"' has no exported member 'type'.

    2 import { type KeyProviderCallbacks } from './events';
               ~~~~
    node_modules/livekit-client/dist/src/room/RTCEngine.d.ts:6:10 - error TS2300: Duplicate identifier 'type'.

    6 import { type AddTrackRequest, type ConnectionQualityUpdate, type JoinResponse, type StreamStateUpdate, SubscribedQualityUpdate, type SubscriptionPermissionUpdate, type SubscriptionResponse, TrackUnpublishedResponse } from '../proto/livekit_rtc_pb';
               ~~~~
    node_modules/livekit-client/dist/src/room/RTCEngine.d.ts:6:32 - error TS2300: Duplicate identifier 'type'.

    6 import { type AddTrackRequest, type ConnectionQualityUpdate, type JoinResponse, type StreamStateUpdate, SubscribedQualityUpdate, type SubscriptionPermissionUpdate, type SubscriptionResponse, TrackUnpublishedResponse } from '../proto/livekit_rtc_pb';
                                     ~~~~
    node_modules/livekit-client/dist/src/room/RTCEngine.d.ts:6:10 - error TS2300: Duplicate identifier 'type'.

    6 import { type AddTrackRequest, type ConnectionQualityUpdate, type JoinResponse, type StreamStateUpdate, SubscribedQualityUpdate, type SubscriptionPermissionUpdate, type SubscriptionResponse, TrackUnpublishedResponse } from '../proto/livekit_rtc_pb';
               ~~~~
    node_modules/livekit-client/dist/src/room/RTCEngine.d.ts:6:62 - error TS2300: Duplicate identifier 'type'.

    6 import { type AddTrackRequest, type ConnectionQualityUpdate, type JoinResponse, type StreamStateUpdate, SubscribedQualityUpdate, type SubscriptionPermissionUpdate, type SubscriptionResponse, TrackUnpublishedResponse } from '../proto/livekit_rtc_pb';
                                                                   ~~~~
    node_modules/livekit-client/dist/src/room/RTCEngine.d.ts:6:10 - error TS2300: Duplicate identifier 'type'.

    6 import { type AddTrackRequest, type ConnectionQualityUpdate, type JoinResponse, type StreamStateUpdate, SubscribedQualityUpdate, type SubscriptionPermissionUpdate, type SubscriptionResponse, TrackUnpublishedResponse } from '../proto/livekit_rtc_pb';
               ~~~~
    node_modules/livekit-client/dist/src/room/RTCEngine.d.ts:6:81 - error TS2300: Duplicate identifier 'type'.

    6 import { type AddTrackRequest, type ConnectionQualityUpdate, type JoinResponse, type StreamStateUpdate, SubscribedQualityUpdate, type SubscriptionPermissionUpdate, type SubscriptionResponse, TrackUnpublishedResponse } from '../proto/livekit_rtc_pb';
                                                                                      ~~~~
    node_modules/livekit-client/dist/src/room/RTCEngine.d.ts:6:10 - error TS2300: Duplicate identifier 'type'.

    6 import { type AddTrackRequest, type ConnectionQualityUpdate, type JoinResponse, type StreamStateUpdate, SubscribedQualityUpdate, type SubscriptionPermissionUpdate, type SubscriptionResponse, TrackUnpublishedResponse } from '../proto/livekit_rtc_pb';
               ~~~~
    node_modules/livekit-client/dist/src/room/RTCEngine.d.ts:6:130 - error TS2300: Duplicate identifier 'type'.

    6 import { type AddTrackRequest, type ConnectionQualityUpdate, type JoinResponse, type StreamStateUpdate, SubscribedQualityUpdate, type SubscriptionPermissionUpdate, type SubscriptionResponse, TrackUnpublishedResponse } from '../proto/livekit_rtc_pb';
                                                                                                                                       ~~~~
    node_modules/livekit-client/dist/src/room/RTCEngine.d.ts:6:10 - error TS2300: Duplicate identifier 'type'.

    6 import { type AddTrackRequest, type ConnectionQualityUpdate, type JoinResponse, type StreamStateUpdate, SubscribedQualityUpdate, type SubscriptionPermissionUpdate, type SubscriptionResponse, TrackUnpublishedResponse } from '../proto/livekit_rtc_pb';
               ~~~~
    node_modules/livekit-client/dist/src/room/RTCEngine.d.ts:6:165 - error TS2300: Duplicate identifier 'type'.

    6 import { type AddTrackRequest, type ConnectionQualityUpdate, type JoinResponse, type StreamStateUpdate, SubscribedQualityUpdate, type SubscriptionPermissionUpdate, type SubscriptionResponse, TrackUnpublishedResponse } from '../proto/livekit_rtc_pb';
                                                                                                                                                                          ~~~~
    node_modules/livekit-client/dist/src/room/RTCEngine.d.ts:6:10 - error TS2305: Module '"../proto/livekit_rtc_pb"' has no exported member 'type'.

    6 import { type AddTrackRequest, type ConnectionQualityUpdate, type JoinResponse, type StreamStateUpdate, SubscribedQualityUpdate, type SubscriptionPermissionUpdate, type SubscriptionResponse, TrackUnpublishedResponse } from '../proto/livekit_rtc_pb';
               ~~~~
    node_modules/livekit-client/dist/src/room/RTCEngine.d.ts:6:32 - error TS2305: Module '"../proto/livekit_rtc_pb"' has no exported member 'type'.

    6 import { type AddTrackRequest, type ConnectionQualityUpdate, type JoinResponse, type StreamStateUpdate, SubscribedQualityUpdate, type SubscriptionPermissionUpdate, type SubscriptionResponse, TrackUnpublishedResponse } from '../proto/livekit_rtc_pb';
                                     ~~~~
    node_modules/livekit-client/dist/src/room/RTCEngine.d.ts:6:62 - error TS2305: Module '"../proto/livekit_rtc_pb"' has no exported member 'type'.

    6 import { type AddTrackRequest, type ConnectionQualityUpdate, type JoinResponse, type StreamStateUpdate, SubscribedQualityUpdate, type SubscriptionPermissionUpdate, type SubscriptionResponse, TrackUnpublishedResponse } from '../proto/livekit_rtc_pb';
                                                                   ~~~~
    node_modules/livekit-client/dist/src/room/RTCEngine.d.ts:6:81 - error TS2305: Module '"../proto/livekit_rtc_pb"' has no exported member 'type'.

    6 import { type AddTrackRequest, type ConnectionQualityUpdate, type JoinResponse, type StreamStateUpdate, SubscribedQualityUpdate, type SubscriptionPermissionUpdate, type SubscriptionResponse, TrackUnpublishedResponse } from '../proto/livekit_rtc_pb';
                                                                                      ~~~~
    node_modules/livekit-client/dist/src/room/RTCEngine.d.ts:6:130 - error TS2305: Module '"../proto/livekit_rtc_pb"' has no exported member 'type'.

    6 import { type AddTrackRequest, type ConnectionQualityUpdate, type JoinResponse, type StreamStateUpdate, SubscribedQualityUpdate, type SubscriptionPermissionUpdate, type SubscriptionResponse, TrackUnpublishedResponse } from '../proto/livekit_rtc_pb';
                                                                                                                                       ~~~~
    node_modules/livekit-client/dist/src/room/RTCEngine.d.ts:6:165 - error TS2305: Module '"../proto/livekit_rtc_pb"' has no exported member 'type'.

    6 import { type AddTrackRequest, type ConnectionQualityUpdate, type JoinResponse, type StreamStateUpdate, SubscribedQualityUpdate, type SubscriptionPermissionUpdate, type SubscriptionResponse, TrackUnpublishedResponse } from '../proto/livekit_rtc_pb';
                                                                                                                                                                          ~~~~
    node_modules/livekit-client/dist/src/e2ee/utils.d.ts:4:45 - error TS2304: Cannot find name 'RTCEncodedAudioFrame'.

    4 export declare function isVideoFrame(frame: RTCEncodedAudioFrame | RTCEncodedVideoFrame): frame is RTCEncodedVideoFrame;
                                                  ~~~~~~~~~~~~~~~~~~~~
    node_modules/livekit-client/dist/src/e2ee/utils.d.ts:4:68 - error TS2304: Cannot find name 'RTCEncodedVideoFrame'.

    4 export declare function isVideoFrame(frame: RTCEncodedAudioFrame | RTCEncodedVideoFrame): frame is RTCEncodedVideoFrame;
                                                                         ~~~~~~~~~~~~~~~~~~~~
    node_modules/livekit-client/dist/src/e2ee/utils.d.ts:4:100 - error TS2304: Cannot find name 'RTCEncodedVideoFrame'.

    4 export declare function isVideoFrame(frame: RTCEncodedAudioFrame | RTCEncodedVideoFrame): frame is RTCEncodedVideoFrame;
davidzhao commented 8 months ago

@harisnewbie could you try enabling skipLibCheck in your tsconfig.json? Since these are types referenced internally to LiveKit SDK, your application should not need to verify types against older Typescript definitions

harisnewbie commented 8 months ago

I tried enabling skipLibCheck but it doesn't seem to fix the issue.

{
  ...,
  "compilerOptions": {
    ...,
    "skipLibCheck": true
  }
}
lukasIO commented 8 months ago

Hi @harisnewbie ,

@davidzhao is right, skipLibCheck should make that error go away. Maybe try with a clean install+build after adding that option? There's also a project called downlevel-ts that you could try to use. We already apply this to make it backwards compatible down to TS 4.2

I'm not super familiar with the angular setup, is angular trying to build the library from scratch or is it "just" doing the typechecking?

harisnewbie commented 8 months ago

Hello @lukasIO, I tried adding skipLibCheck in tsconfig and clean installed the dependencies, but it didn't help. Also, I upgraded the version the Angular version to 12, which also upgraded typescript to 4.3.5. I am still facing the same issue.

Stackblitz URL : https://base-angular-12-app-9pfoeg.stackblitz.io

lukasIO commented 8 months ago

thanks for the stackblitz reproduction, could we get an editable link for this, too? right now there's no way (I think) to see the setup code, only the output gets shown on that link

harisnewbie commented 8 months ago

Here you go : https://stackblitz.com/edit/base-angular-12-app-9pfoeg

lukasIO commented 8 months ago

hm, with ivy disabled it starts working for me https://stackblitz.com/edit/base-angular-12-app-tk1ssq?file=tsconfig.json also added the skipLibCheck and an exclude parameter in the tsconfig.json.

I think the path to tsconfig.json was wrong in angular.json. It was trying to load tsconfig.app.json which (at least in this setup) didn't exist

harisnewbie commented 8 months ago

Below is my current tsconfig.json

/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
  "compileOnSave": false,
  "compilerOptions": {
    "types": ["gapi", "gapi.auth2"],
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "downlevelIteration": true,
    "experimentalDecorators": true,
    "moduleResolution": "node",
    "importHelpers": true,
    "target": "es2015",
    "module": "es2020",
    "lib": [
      "es2018",
      "dom"
    ],
    "skipLibCheck": true,
  },
  "exclude": ["node_modules/livekit-client/*"],
  "angularCompilerOptions" : {
    "enaableIvy" : false
  }
}

I am not sure where I am going wrong but it won't work in the main project. Let me keep trying.

lukasIO commented 8 months ago

"exclude": ["node_modules/livekit-client/*"],

with flattened dependencies (the default for npm) it probably won't be enough to exclude livekit-client as most of the errors you posted at the beginning of the thread originate from a third party dependency (protobuf-es) that livekit-client uses internally.

"enaableIvy" : false

there's a typo in there. Also, I read that since Angular 12 you cannot "simply" disable ivy? not sure how that works, for stackblitz there was an explicit option in the settings menu for that.

harisnewbie commented 8 months ago

I changed the value for exclude parameter to

  "exclude": [
    "node_modules",
    "./node_modules",
    "./node_modules/*"
  ],

And yes, you're right. Disabling Ivy is not an option from Angular 12 and above. :(

makz21 commented 4 months ago

@harisnewbie did you find the solution? I have the same problem and unfortunately the methods mentioned above do not work for me.