Open harisnewbie opened 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
I tried enabling skipLibCheck but it doesn't seem to fix the issue.
{
...,
"compilerOptions": {
...,
"skipLibCheck": true
}
}
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?
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
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
Here you go : https://stackblitz.com/edit/base-angular-12-app-9pfoeg
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
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.
"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.
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. :(
@harisnewbie did you find the solution? I have the same problem and unfortunately the methods mentioned above do not work for me.
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:
npx -p @angular/cli@10.2.3 ng new angular10App
npm install livekit-client --save
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