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

Compile Error 8.4.0 #157

Closed
xenoterracide opened this issue Nov 12, 2020 · 10 comments
Closed

Compile Error 8.4.0 #157

xenoterracide opened this issue Nov 12, 2020 · 10 comments
Labels
bug Something isn't working limitation We're limited here needs investigation Extra info is needed

Comments

@xenoterracide
Copy link

xenoterracide commented Nov 12, 2020

this happens just by having a module that depends on ts-toolbelt installed

.yarn/cache/ts-toolbelt-npm-8.4.0-f6995cd030-dbc3ad2626.zip/node_modules/ts-toolbelt/out/index.d.ts:983:46 - error TS1110: Type expected.

983     export type NumberOf<N extends number> = `${N}`;

this repo reproduces the issue https://github.com/xenoterracide/merge-anything-compilation-issues you can do yarn && yarn build to see the issue.

cross referencing mesqueeb/merge-anything#13

@millsp
Copy link
Owner

millsp commented Nov 12, 2020

I think that you need ts >= 4.1

@millsp millsp added the question More info is requested label Nov 12, 2020
@xenoterracide
Copy link
Author

you mean typescript? that's not out yet... trying to clarify whether this is a problem where merge-anything needs to fix its deps. Since I don't have a direct dependency on ts-toolbelt

@millsp
Copy link
Owner

millsp commented Nov 12, 2020

@mesqueeb's merge-anything is using the next version of ts-toolbelt. TypeScript 4.1 will be released in 5 days.

@millsp millsp closed this as completed Nov 12, 2020
@xenoterracide
Copy link
Author

This whole thing seems like a hot mess, thanks.

@mesqueeb
Copy link
Contributor

@millsp
Copy link
Owner

millsp commented Nov 13, 2020

Yep, sorry @mesqueeb. Don't know how this happened.
https://www.npmjs.com/package/ts-toolbelt?activeTab=versions

@adomoshe
Copy link

adomoshe commented Feb 4, 2021

To anyone facing this issue currently I just hard set my ts-toolbelt version in my lock file

@AlexeyDrobot
Copy link

An alternative way to install the correct version of the nested dependency.

"resolutions": { "ts-toolbelt": "8.0.7" },

@millsp millsp reopened this Feb 4, 2021
@millsp
Copy link
Owner

millsp commented Feb 4, 2021

Fixing this will cause breaking changes, it's not easy because there is global scope pollution. If I fix this, people using global imports will break. If I don't, it breaks only for people that use two different versions of ts-toolbelt at the same time. This has been fixed in version 9.

@millsp millsp closed this as completed Feb 4, 2021
@millsp millsp added bug Something isn't working limitation We're limited here needs investigation Extra info is needed and removed question More info is requested labels Feb 4, 2021
@themaskedavenger
Copy link

Specifying version 8.0.7 in resolutions, I am seeing the following errors:

> Transpiling typescript files...
node_modules/ts-toolbelt/out/index.d.ts:330:9 - error TS2574: A rest element type must be an array type.

330         ...L
            ~~~~

node_modules/ts-toolbelt/out/index.d.ts:840:9 - error TS1256: A rest element must be last in a tuple type.

840         ...L,
            ~~~~

node_modules/ts-toolbelt/out/index.d.ts:1985:65 - error TS2574: A rest element type must be an array type.

1985     export type Tail<L extends List> = L extends readonly [any, ...infer LTail] ? LTail : L;
                                                                     ~~~~~~~~~~~~~~

node_modules/ts-toolbelt/out/index.d.ts:2255:9 - error TS1256: A rest element must be last in a tuple type.

2255         ...L,
             ~~~~

node_modules/ts-toolbelt/out/index.d.ts:6645:60 - error TS1256: A rest element must be last in a tuple type.

6645     export type Pop<L extends List> = L extends (readonly [...infer LBody, any] | readonly [...infer LBody, any?]) ? LBody : L;
                                                                ~~~~~~~~~~~~~~

node_modules/ts-toolbelt/out/index.d.ts:6645:93 - error TS1256: A rest element must be last in a tuple type.

6645     export type Pop<L extends List> = L extends (readonly [...infer LBody, any] | readonly [...infer LBody, any?]) ? LBody : L;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working limitation We're limited here needs investigation Extra info is needed
Projects
None yet
Development

No branches or pull requests

6 participants