Typings issue in v3.3.0
See original GitHub issueWhen using Listr2 in a TypeScript project I am getting the following TSC error when using v3.3.0:
../../node_modules/listr2/dist/lib/task-wrapper.d.ts:27:5 - error TS2416: Property 'run' in type 'TaskWrapper<Ctx, Renderer>' is not assignable to the same property in base type 'ListrTaskWrapper<Ctx, Renderer>'.
Type '(ctx: Ctx) => Promise<void>' is not assignable to type '(ctx?: Ctx | undefined, task?: ListrTaskWrapper<Ctx, Renderer> | undefined) => Promise<void>'.
Types of parameters 'ctx' and 'ctx' are incompatible.
Type 'Ctx | undefined' is not assignable to type 'Ctx'.
'Ctx' could be instantiated with an arbitrary type which could be unrelated to 'Ctx | undefined'.
Type 'undefined' is not assignable to type 'Ctx'.
'Ctx' could be instantiated with an arbitrary type which could be unrelated to 'undefined'.
27 run(ctx: Ctx): Promise<void>;
It compiles fine with the previous v3.2.3.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:14 (7 by maintainers)
Top Results From Across the Web
TypeScript v 3.0.3: Cannot find global type 'Promise' #2244
I am seeing the following error while trying to compile using TypesScript v3.0.3. There is no context other than what you see below....
Read more >Documentation - TypeScript 3.0
TypeScript 3.0 introduces a new concept of project references. Project references allow TypeScript projects to depend on other TypeScript projects ...
Read more >angular - typings install permission error
This is already answered at. npm install error unable to read typings. Try few options available there. the last one worked for me....
Read more >Small issue with new version v3.3.0 (linked scripts) - Get help
Following the update (Web version) quite a few of my scripts fell over! in particular some (not all) references were suddenly dropped (even...
Read more >Support for type hints — Python 3.11.1 documentation
Source code: Lib/typing.py This module provides runtime support for type hints. ... The problem with this approach is that a class had to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Mr. @appkaiju, I tried that some other way setting the default context to
any | undefined
because it gets injected from the main class to the task wrapper, but the combination of that with converting run from arrow function seems to solve the issue. I will merge it to the main branch now.https://repl.it/@CenkKl/List2-repro#index.js
Sorry this took a little bit more than expected, I had some computer problems.
Hi, @cenk1cenk2. Do you think that changing TaskWrapper.d.ts to
run(ctx: Ctx | undefined): Promise<void>;
. would be enough? I don’t see any issues with it.