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

Cannot find name 'unknown'. #36

Closed
symis84 opened this issue May 12, 2019 · 7 comments
Closed

Cannot find name 'unknown'. #36

symis84 opened this issue May 12, 2019 · 7 comments

Comments

@symis84
Copy link

symis84 commented May 12, 2019

platform: win10

ERROR in node_modules/type-fest/index.d.ts(20,23): error TS2304: Cannot find name 'unknown'.
node_modules/type-fest/index.d.ts(61,30): error TS2304: Cannot find name 'unknown'.
node_modules/type-fest/source/package-json.d.ts(60,28): error TS2304: Cannot find name 'unknown'.
node_modules/type-fest/source/package-json.d.ts(375,24): error TS2304: Cannot find name 'unknown'.
node_modules/type-fest/source/package-json.d.ts(486,21): error TS2304: Cannot find name 'unknown'.
node_modules/type-fest/source/package-json.d.ts(493,17): error TS2304: Cannot find name 'unknown'.

@CvX
Copy link
Contributor

CvX commented May 12, 2019

Type-fest uses the unknown type introduced in TypeScript 3.0. What's your TS version?

I wonder if there's a way to show a nicer error explaining which TS version is required at a minimum?

@BendingBender
Copy link
Contributor

I don't think that this library will work for TS < 3.2 becase we now use bigint primitive type that was introduced in TS 3.2.

@symis84
Copy link
Author

symis84 commented May 12, 2019

@angular/[email protected] requires typescript@'>=2.7.2 <2.10' but 3.4.5 was found instead.
Using this version can result in undefined behaviour and difficult to debug problems.

Please run the following command to install a compatible version of TypeScript.

npm install typescript@">=2.7.2 <2.10"

To disable this warning run "ng config cli.warnings.typescriptMismatch false".

Basically, i need to update my Angular project to the latest Angular 7 if i want to use this library

@sindresorhus
Copy link
Owner

@BendingBender I think we add typescript as a peer dependency. That way we can make it clear what typescript version we support. Thoughts?

@BendingBender
Copy link
Contributor

Sounds good to me. Let's try this out.

@CvX
Copy link
Contributor

CvX commented May 13, 2019

My experiences with peer dependencies range from "doesn't work at all" to "gives a bunch of invalid warnings" 😉 but at the very least it will document minimal TS version in the package.json, so that's a win. 😄

@sindresorhus
Copy link
Owner

Actually, this was a bad idea. It means it now complains about TypeScript in a non-TS project that uses type-fest just for the index.d.ts.

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

4 participants