Commit 94bdbc7
committed
fix: Fixes type error when build in jitsi-meet.
When TypeScript runs inside node_modules/lib-jitsi-meet, it doesn't just look in its own node_modules/@types/ — Node.js module resolution walks up
the directory tree. So it also finds jitsi-meet/node_modules/@types/node (version 20.17.6).
The lib-jitsi-meet code explicitly types timeout variables as NodeJS.Timeout:
// VADNoiseDetection.ts:65
private _processTimeout?: NodeJS.Timeout;
// ResumeTask.ts:27
private _resumeTimeout: Optional<NodeJS.Timeout>;
But lib-jitsi-meet's own tsconfig.json only specifies "lib": ["DOM", "ES2021", "ES2024.Promise"] with no Node.js lib. So when DOM lib is active,
setTimeout() is the DOM version which returns number. The outer jitsi-meet's @types/node v20.17.6 defines NodeJS.Timeout as a class (with .ref(),
.unref(), etc.), which is not compatible with number. Hence the mismatch:
Type 'number' is not assignable to type 'Timeout'1 parent 94d0e53 commit 94bdbc7
2 files changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
0 commit comments