mixpanel / mixpanel-js

Official Mixpanel JavaScript Client Library
https://mixpanel.com/help/reference/javascript
Apache License 2.0
902 stars 315 forks source link

[Typescript V5.7.3] - Conflict with typescript lib.dom.d.ts #471

Open yasharth-98 opened 1 month ago

yasharth-98 commented 1 month ago

I am experiencing a TypeScript type conflict when using the @types/css-font-loading-module package in conjunction with TypeScript 5.0. The conflict arises from the display property in the FontFace interface, which is defined with different types in lib.dom.d.ts and @types/css-font-loading-module.

Expected Behavior

The TypeScript compiler should not throw any type errors related to the display property in the FontFace interface.

Actual Behavior

node_modules/@types/css-font-loading-module/index.d.ts:22:9 - error TS2717: Subsequent property declarations must have the same type. Property 'display' must be of type 'FontDisplay', but here has type 'string'.

22 display?: string | undefined; ~~~

node_modules/typescript/lib/lib.dom.d.ts:515:5 515 display?: FontDisplay; ~~~ 'display' was also declared here.

node_modules/@types/css-font-loading-module/index.d.ts:42:9 - error TS2717: Subsequent property declarations must have the same type. Property 'display' must be of type 'FontDisplay', but here has type 'string'.

42 display: string; ~~~

node_modules/typescript/lib/lib.dom.d.ts:5537:5 5537 display: FontDisplay; ~~~ 'display' was also declared here.

tdumitrescu commented 1 month ago

Did you mean to open this issue on a different repo?

yasharth-98 commented 1 month ago

Did you mean to open this issue on a different repo?

mixpanel-browser has dependency on @types/css-font-loading-module

tdumitrescu commented 1 month ago

It appears to be a subdependency via rrweb. Have you tried anything from this issue yet? https://github.com/rrweb-io/rrweb/issues/813

Yejin0O0 commented 1 month ago

It appears to be a subdependency via rrweb. Have you tried anything from this issue yet? rrweb-io/rrweb#813

I had a same issue. With "skipLibCheck": true option in tsconfig.json, I can fix the issue.