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

Type-fest TS errors when updating to tsc 4.8 #29

Closed
curiousdannii opened this issue Sep 21, 2022 · 3 comments
Closed

Type-fest TS errors when updating to tsc 4.8 #29

curiousdannii opened this issue Sep 21, 2022 · 3 comments

Comments

@curiousdannii
Copy link

curiousdannii commented Sep 21, 2022

My project depends on ansi-escapes@5.0.0. When I tried updating to tsc 4.8, I'm now getting these errors:

node_modules/type-fest/ts41/get.d.ts:95:37 - error TS2344: Type 'BaseType' does not satisfy the constraint 'Record<string | number, any>'.

95  : Key extends keyof WithStringKeys<BaseType>
                                       ~~~~~~~~

  node_modules/type-fest/ts41/get.d.ts:79:17
    79 type PropertyOf<BaseType, Key extends string> =
                       ~~~~~~~~
    This type parameter might need an `extends Record<string | number, any>` constraint.

node_modules/type-fest/ts41/get.d.ts:96:19 - error TS2344: Type 'BaseType' does not satisfy the constraint 'Record<string | number, any>'.

96  ? WithStringKeys<BaseType>[Key]
                     ~~~~~~~~

  node_modules/type-fest/ts41/get.d.ts:79:17
    79 type PropertyOf<BaseType, Key extends string> =
                       ~~~~~~~~
    This type parameter might need an `extends Record<string | number, any>` constraint.


Found 2 errors in the same file, starting at: node_modules/type-fest/ts41/get.d.ts:95

Would updating this package's type-fest version help? But I see that it updates the minimum TS version supported, so updating it might be a semver major change? Slightly messy.

@curiousdannii
Copy link
Author

Thank you!

@curiousdannii
Copy link
Author

curiousdannii commented Mar 22, 2024

I'm getting errors again when updated to Typescript 5.4.

node_modules/type-fest/source/merge-deep.d.ts:140:5 - error TS2321: Excessive stack depth comparing types 'PickRestType<ArrayTail<ArrayTail<Destination>>>[number]' and 'UnknownArrayOrTuple'.

140 > = [
        ~
141  ...DoMergeDeepTupleAndTupleRecursive<OmitRestType<Destination>, OmitRestType<Source>, PickRestTypeFlat<Destination>, PickRestTypeFlat<Source>, Options>,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
142  ...MergeDeepArrayOrTupleElements<PickRestType<Destination>, PickRestType<Source>, Options>,
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
143 ];
    ~

Honestly, I'm only using this package for 4 of constants, not any of the functions. It might be best to just directly embed them in my project.

curiousdannii added a commit to curiousdannii/asyncglk that referenced this issue Mar 22, 2024
Fix read() for non-existent files
Prepare for Windows-POSIX path conversions, though I didn't do the actual conversions yet
Update to Typescript 5.4, and embed the few ansi-escapes we were using, because of sindresorhus/ansi-escapes#29
@sindresorhus
Copy link
Owner

I have inlined the needed TypeScript type, so this should not happen again.

https://github.com/sindresorhus/ansi-escapes/releases/tag/v6.2.1

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