question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Compiler errors when building

See original GitHub issue

Hi, I am using Listr2 in a project and getting a bunch of errorrs from the declaration files that this library exports.

tsc -v Version 4.0.2

here is my tsconfig

{
  "compilerOptions": {
    "composite": true,
    "declaration": true,
    "declarationMap": true,
    "importHelpers": true,
    "module": "commonjs",
    "strict": true,
    "target": "es2017",
    "esModuleInterop": true,
    "lib": ["ESNext", "dom"],
    "sourceMap": true,
    "moduleResolution": "node",
    "noImplicitReturns": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "pretty": true
  },
  "exclude": [
    "node_modules",
    "**/*.test.ts"
  ],
  "include": [
    "src/**/*"
  ]
}

running tsc -b emits the errors below

@typerpc/cli:     The type 'readonly ListrTaskObject<any, ListrRendererFactory>[]' is 'readonly' and cannot be assigned to the mutable type 'ListrTaskObject<any, typeof DefaultRenderer>[]'.
@typerpc/cli: ../../node_modules/listr2/dist/renderer/default.renderer.d.ts(30,45): error TS2344: Type 'typeof DefaultRenderer' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/renderer/default.renderer.d.ts(31,47): error TS2344: Type 'typeof DefaultRenderer' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/renderer/default.renderer.d.ts(32,44): error TS2344: Type 'typeof DefaultRenderer' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/renderer/default.renderer.d.ts(33,52): error TS2344: Type 'typeof DefaultRenderer' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/renderer/default.renderer.d.ts(34,41): error TS2344: Type 'typeof DefaultRenderer' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/renderer/default.renderer.d.ts(35,44): error TS2344: Type 'typeof DefaultRenderer' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/renderer/silent.renderer.d.ts(3,33): error TS2344: Type 'typeof SilentRenderer' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli:   Types of parameters 'tasks' and 'tasks' are incompatible.
@typerpc/cli:     The type 'readonly ListrTaskObject<any, ListrRendererFactory>[]' is 'readonly' and cannot be assigned to the mutable type 'ListrTaskObject<any, typeof SilentRenderer>[]'.
@typerpc/cli: ../../node_modules/listr2/dist/renderer/silent.renderer.d.ts(8,45): error TS2344: Type 'typeof SilentRenderer' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/renderer/verbose.renderer.d.ts(4,33): error TS2344: Type 'typeof VerboseRenderer' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli:   Types of parameters 'tasks' and 'tasks' are incompatible.
@typerpc/cli:     The type 'readonly ListrTaskObject<any, ListrRendererFactory>[]' is 'readonly' and cannot be assigned to the mutable type 'ListrTaskObject<any, typeof VerboseRenderer>[]'.
@typerpc/cli: ../../node_modules/listr2/dist/renderer/verbose.renderer.d.ts(15,45): error TS2344: Type 'typeof VerboseRenderer' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/interfaces/listr.interface.d.ts(18,22): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli:   Type 'typeof DefaultRenderer | (Renderer extends "verbose" ? typeof VerboseRenderer : Renderer extends "silent" ? typeof SilentRenderer : Renderer extends ListrRendererFactory ? Renderer : never)' is not assignable to type 'ListrRendererFactory'.
@typerpc/cli:     Type 'typeof DefaultRenderer' is not assignable to type 'ListrRendererFactory'.
@typerpc/cli:       Type 'ListrRendererFactory | typeof DefaultRenderer | typeof VerboseRenderer | typeof SilentRenderer' is not assignable to type 'ListrRendererFactory'.
@typerpc/cli:         Type 'typeof DefaultRenderer' is not assignable to type 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/interfaces/listr.interface.d.ts(19,48): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/interfaces/listr.interface.d.ts(21,31): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/interfaces/listr.interface.d.ts(21,99): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/interfaces/listr.interface.d.ts(109,33): error TS2344: Type 'typeof ListrBaseRenderer' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli:   Types of parameters 'tasks' and 'tasks' are incompatible.
@typerpc/cli:     The type 'readonly ListrTaskObject<any, ListrRendererFactory>[]' is 'readonly' and cannot be assigned to the mutable type 'ListrTaskObject<any, typeof ListrBaseRenderer>[]'.
@typerpc/cli: ../../node_modules/listr2/dist/interfaces/listr.interface.d.ts(111,45): error TS2344: Type 'typeof ListrBaseRenderer' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/listr.d.ts(4,26): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli:   Type 'typeof DefaultRenderer | (Renderer extends "verbose" ? typeof VerboseRenderer : Renderer extends "silent" ? typeof SilentRenderer : Renderer extends ListrRendererFactory ? Renderer : never)' is not assignable to type 'ListrRendererFactory'.
@typerpc/cli:     Type 'typeof DefaultRenderer' is not assignable to type 'ListrRendererFactory'.
@typerpc/cli:       Type 'ListrRendererFactory | typeof DefaultRenderer | typeof VerboseRenderer | typeof SilentRenderer' is not assignable to type 'ListrRendererFactory'.
@typerpc/cli:         Type 'typeof DefaultRenderer' is not assignable to type 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/listr.d.ts(4,85): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/listr.d.ts(6,22): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/listr.d.ts(13,38): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/listr.d.ts(13,97): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/listr.d.ts(14,30): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/listr.d.ts(14,89): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/manager.d.ts(9,54): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli:   Type 'typeof DefaultRenderer | (Renderer extends "verbose" ? typeof VerboseRenderer : Renderer extends "silent" ? typeof SilentRenderer : Renderer extends ListrRendererFactory ? Renderer : never)' is not assignable to type 'ListrRendererFactory'.
@typerpc/cli:     Type 'typeof DefaultRenderer' is not assignable to type 'ListrRendererFactory'.
@typerpc/cli:       Type 'ListrRendererFactory | typeof DefaultRenderer | typeof VerboseRenderer | typeof SilentRenderer' is not assignable to type 'ListrRendererFactory'.
@typerpc/cli:         Type 'typeof DefaultRenderer' is not assignable to type 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/manager.d.ts(9,143): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/manager.d.ts(11,177): error TS2344: Type 'ListrGetRendererClassFromValue<InjectRenderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli:   Type 'typeof DefaultRenderer | (InjectRenderer extends "verbose" ? typeof VerboseRenderer : InjectRenderer extends "silent" ? typeof SilentRenderer : InjectRenderer extends ListrRendererFactory ? InjectRenderer : never)' is not assignable to type 'ListrRendererFactory'.
@typerpc/cli:     Type 'typeof DefaultRenderer' is not assignable to type 'ListrRendererFactory'.
@typerpc/cli:       Type 'ListrRendererFactory | typeof DefaultRenderer | typeof VerboseRenderer | typeof SilentRenderer' is not assignable to type 'ListrRendererFactory'.
@typerpc/cli:         Type 'typeof DefaultRenderer' is not assignable to type 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/manager.d.ts(12,57): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/manager.d.ts(12,146): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/manager.d.ts(12,304): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/manager.d.ts(12,378): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/manager.d.ts(13,54): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.


@typerpc/cli:     The type 'readonly ListrTaskObject<any, ListrRendererFactory>[]' is 'readonly' and cannot be assigned to the mutable type 'ListrTaskObject<any, typeof DefaultRenderer>[]'.
@typerpc/cli: ../../node_modules/listr2/dist/renderer/default.renderer.d.ts(30,45): error TS2344: Type 'typeof DefaultRenderer' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/renderer/default.renderer.d.ts(31,47): error TS2344: Type 'typeof DefaultRenderer' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/renderer/default.renderer.d.ts(32,44): error TS2344: Type 'typeof DefaultRenderer' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/renderer/default.renderer.d.ts(33,52): error TS2344: Type 'typeof DefaultRenderer' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/renderer/default.renderer.d.ts(34,41): error TS2344: Type 'typeof DefaultRenderer' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/renderer/default.renderer.d.ts(35,44): error TS2344: Type 'typeof DefaultRenderer' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/renderer/silent.renderer.d.ts(3,33): error TS2344: Type 'typeof SilentRenderer' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli:   Types of parameters 'tasks' and 'tasks' are incompatible.
@typerpc/cli:     The type 'readonly ListrTaskObject<any, ListrRendererFactory>[]' is 'readonly' and cannot be assigned to the mutable type 'ListrTaskObject<any, typeof SilentRenderer>[]'.
@typerpc/cli: ../../node_modules/listr2/dist/renderer/silent.renderer.d.ts(8,45): error TS2344: Type 'typeof SilentRenderer' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/renderer/verbose.renderer.d.ts(4,33): error TS2344: Type 'typeof VerboseRenderer' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli:   Types of parameters 'tasks' and 'tasks' are incompatible.
@typerpc/cli:     The type 'readonly ListrTaskObject<any, ListrRendererFactory>[]' is 'readonly' and cannot be assigned to the mutable type 'ListrTaskObject<any, typeof VerboseRenderer>[]'.
@typerpc/cli: ../../node_modules/listr2/dist/renderer/verbose.renderer.d.ts(15,45): error TS2344: Type 'typeof VerboseRenderer' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/interfaces/listr.interface.d.ts(18,22): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli:   Type 'typeof DefaultRenderer | (Renderer extends "verbose" ? typeof VerboseRenderer : Renderer extends "silent" ? typeof SilentRenderer : Renderer extends ListrRendererFactory ? Renderer : never)' is not assignable to type 'ListrRendererFactory'.
@typerpc/cli:     Type 'typeof DefaultRenderer' is not assignable to type 'ListrRendererFactory'.
@typerpc/cli:       Type 'ListrRendererFactory | typeof DefaultRenderer | typeof VerboseRenderer | typeof SilentRenderer' is not assignable to type 'ListrRendererFactory'.
@typerpc/cli:         Type 'typeof DefaultRenderer' is not assignable to type 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/interfaces/listr.interface.d.ts(19,48): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/interfaces/listr.interface.d.ts(21,31): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/interfaces/listr.interface.d.ts(21,99): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/interfaces/listr.interface.d.ts(109,33): error TS2344: Type 'typeof ListrBaseRenderer' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli:   Types of parameters 'tasks' and 'tasks' are incompatible.
@typerpc/cli:     The type 'readonly ListrTaskObject<any, ListrRendererFactory>[]' is 'readonly' and cannot be assigned to the mutable type 'ListrTaskObject<any, typeof ListrBaseRenderer>[]'.
@typerpc/cli: ../../node_modules/listr2/dist/interfaces/listr.interface.d.ts(111,45): error TS2344: Type 'typeof ListrBaseRenderer' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/listr.d.ts(4,26): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli:   Type 'typeof DefaultRenderer | (Renderer extends "verbose" ? typeof VerboseRenderer : Renderer extends "silent" ? typeof SilentRenderer : Renderer extends ListrRendererFactory ? Renderer : never)' is not assignable to type 'ListrRendererFactory'.
@typerpc/cli:     Type 'typeof DefaultRenderer' is not assignable to type 'ListrRendererFactory'.
@typerpc/cli:       Type 'ListrRendererFactory | typeof DefaultRenderer | typeof VerboseRenderer | typeof SilentRenderer' is not assignable to type 'ListrRendererFactory'.
@typerpc/cli:         Type 'typeof DefaultRenderer' is not assignable to type 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/listr.d.ts(4,85): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/listr.d.ts(6,22): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/listr.d.ts(13,38): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/listr.d.ts(13,97): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/listr.d.ts(14,30): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/listr.d.ts(14,89): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/manager.d.ts(9,54): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli:   Type 'typeof DefaultRenderer | (Renderer extends "verbose" ? typeof VerboseRenderer : Renderer extends "silent" ? typeof SilentRenderer : Renderer extends ListrRendererFactory ? Renderer : never)' is not assignable to type 'ListrRendererFactory'.
@typerpc/cli:     Type 'typeof DefaultRenderer' is not assignable to type 'ListrRendererFactory'.
@typerpc/cli:       Type 'ListrRendererFactory | typeof DefaultRenderer | typeof VerboseRenderer | typeof SilentRenderer' is not assignable to type 'ListrRendererFactory'.
@typerpc/cli:         Type 'typeof DefaultRenderer' is not assignable to type 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/manager.d.ts(9,143): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/manager.d.ts(11,177): error TS2344: Type 'ListrGetRendererClassFromValue<InjectRenderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli:   Type 'typeof DefaultRenderer | (InjectRenderer extends "verbose" ? typeof VerboseRenderer : InjectRenderer extends "silent" ? typeof SilentRenderer : InjectRenderer extends ListrRendererFactory ? InjectRenderer : never)' is not assignable to type 'ListrRendererFactory'.
@typerpc/cli:     Type 'typeof DefaultRenderer' is not assignable to type 'ListrRendererFactory'.
@typerpc/cli:       Type 'ListrRendererFactory | typeof DefaultRenderer | typeof VerboseRenderer | typeof SilentRenderer' is not assignable to type 'ListrRendererFactory'.
@typerpc/cli:         Type 'typeof DefaultRenderer' is not assignable to type 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/manager.d.ts(12,57): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/manager.d.ts(12,146): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/manager.d.ts(12,304): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/manager.d.ts(12,378): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.
@typerpc/cli: ../../node_modules/listr2/dist/manager.d.ts(13,54): error TS2344: Type 'ListrGetRendererClassFromValue<Renderer>' does not satisfy the constraint 'ListrRendererFactory'.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
ajhenrycommented, Sep 17, 2020

I ran into this issue too when building locally and rather than trying to fix all the types I just skipped the lib type check with this typescript compiler flag

"skipLibCheck": true
0reactions
cenk1cenk2commented, Oct 24, 2020

🎉 This issue has been resolved in version 3.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error building Player because scripts had compiler errors
Hi everyone. I have a problem building my game and I have no idea why. When it starts compiling scripts, the progress bar...
Read more >
Error building Player because scripts have compile errors in ...
When Unity is building your project, it ignores any script placed in this folder since it considers them as an Editor script or...
Read more >
Understanding and fixing compiler and linker errors
Errors are conditions that prevent the compiler from completing the compilation of your files. Compiler errors are restricted to single source code files...
Read more >
Project build errors and warnings (PRJxxxx) - Microsoft Learn
In this article​​ The Visual Studio compilers and build tools can report many kinds of errors and warnings. After an error or warning...
Read more >
Handling Compiler Errors in Visual Micro
How to track the reasons of Arduino compiler errors and guidance on how to fix compiler errors with the least possible ... Output...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found