Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timeout has wrong type in decorator-sample #1027

Closed
AlexanderSambale opened this issue May 18, 2024 · 1 comment
Closed

timeout has wrong type in decorator-sample #1027

AlexanderSambale opened this issue May 18, 2024 · 1 comment

Comments

@AlexanderSambale
Copy link

Extension sample

decorator-sample

VS Code version

1.89.1

What went wrong?

I tried to compile it and it fails, because timeout is of type Timer and not Timeout:


> decorator-sample@0.0.1 compile
> tsc -p ./

src/extension.ts:60:17 - error TS2345: Argument of type 'Timer' is not assignable to parameter of type 'string | number | Timeout | undefined'.
  Property '[Symbol.dispose]' is missing in type 'Timer' but required in type 'Timeout'.

60    clearTimeout(timeout);
                   ~~~~~~~

  node_modules/@types/node/timers.d.ts:76:17
    76                 [Symbol.dispose](): void;
                       ~~~~~~~~~~~~~~~~~~~~~~~~~
    '[Symbol.dispose]' is declared here.


Found 1 error in src/extension.ts:60
meermustan added a commit to meermustan/vscode-extension-samples that referenced this issue Jun 4, 2024
 - Fixes the issue microsoft#1027 that while compiling, Timer is Not  assignable to parameter of type 'string', So Changes the NodeJs.Timer to NodeJs.Timeout
 - After that it's gives another compile error in library so in tscondig.json added flag to skipLibCheck
 - Now it's compiling successfully
meermustan added a commit to meermustan/vscode-extension-samples that referenced this issue Jun 9, 2024
@mjbvz
Copy link
Collaborator

mjbvz commented Jun 27, 2024

Was fixed during the updated to TS 5.5 I believe

@mjbvz mjbvz closed this as completed Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants