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.

ExtenderType, ExtenderTypeOptional do not satisfy the constraint

See original GitHub issue

Describe the bug 🐛

I think 34759d2eb3d96602be372537b0e0392e1d03ae7d introduced a bug to TS definitions.

(type parameter) T in type ExtenderType<T>
Type 'T[P]' does not satisfy the constraint '(...args: any) => any'.
  Type 'T[keyof T]' is not assignable to type '(...args: any) => any'.
    Type 'T[string] | T[number] | T[symbol]' is not assignable to type '(...args: any) => any'.
      Type 'T[string]' is not assignable to type '(...args: any) => any'.ts(2344)

To Reproduce 📝

Build failure:

https://github.com/ScaleLeap/config/pull/44/checks?check_run_id=602773264

But also just inspecting the env-var.d.ts will display the errors in VS Code.

Expected behaviour 🤷‍♂️🤷

No errors.

Screenshots 📷

Screen-Shot-2020-04-21-16-03-16

Environment (please complete the following information) 💻:

  • OS: macOS
  • Runtime: VS Code, CLI
  • Version:
❯ tsc -v
Version 3.8.3
❯ node -v
v12.16.0

Additional context

N/A

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
evanshortisscommented, Apr 21, 2020

@moltar can you test the 6.x branch with your application? I believe it resolves the issue.

0reactions
evanshortisscommented, Apr 23, 2020

Likewise, thank you for the report.

I’ll need to look into the testing, since I want these things to be caught by CI! It seems like I need a separate project or something to fully test, since the sample I use in this repo clearly isn’t doing the trick.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Type does not satisfy the constraint and incorrectly extends ...
I'm trying to implement a generic Specification pattern and a generic Visitor pattern together. Here are my base interfaces ...
Read more >
[NewErrors] 4.8.0-dev.20220609 vs 4.7.3 #49461 - GitHub
error TS2344: Type 'K' does not satisfy the constraint ... 's second type argument is constrained: K extends Record<string, any> = {} ....
Read more >
Constraints on type parameters - C# Programming Guide
If client code uses a type that doesn't satisfy a constraint, the compiler issues an error. Constraints are specified by using the where ......
Read more >
TypeScript - Sequelize
Sequelize Models accept two generic types to define what the model's Attributes & Creation Attributes are like: import { Model, Optional } from ......
Read more >
Useful Patterns by Use Case - React TypeScript Cheatsheets
Type '"foo"' is not assignable to type '"button" | "submit" | "reset" | undefined'.(2322) ... export interface ButtonProps extends React.
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