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

typescript 2.8 problem with 2.27.2 #67

Closed
valera33 opened this issue Jul 4, 2018 · 5 comments
Closed

typescript 2.8 problem with 2.27.2 #67

valera33 opened this issue Jul 4, 2018 · 5 comments
Milestone

Comments

@valera33
Copy link

valera33 commented Jul 4, 2018

we are still on typescript 2.8 and we are having such error with latest version 2.27.2 :

node_modules/tsutils/typeguard/node.d.ts:67:69 - error TS2694: Namespace 'ts' has no exported member 'ImportTypeNode'.

67 export declare function isImportTypeNode(node: ts.Node): node is ts.ImportTypeNode;

on 2.27.1 it was fine because this line was under // @internal

was this change made by accident, or we just have to stay on 2.27.1 until we upgrade to 2.9 typescript?
2.8 typescript is still supported if I read correctly your package.json

@ajafff
Copy link
Owner

ajafff commented Jul 4, 2018

You probably made a mistake with the version of tsutils in your issue report (2.7.1 of this library is really old)...

Anyways, that change was intentional. The function was added but only exposed once the corresponding version of TypeScript was officially released.

Unfortunately supporting older versions of TypeScript is a real PITA API-wise. It would require this library to only expose type declarations for the minimum supported TS version. That would prevent adding functions like isImportTypeNode.

For the time being you can only stay at the older version or use skipLibCheck: true in your compilerOptions.


An approach I'm currently investigating is splitting the modules by TS-version. You would import tsutils/typeguard/2.8 which contains only functions compatible with TS2.8. Then there would be another module tsutils/typeguard/2.9 that re-exports everything from 2.8 plus adds new functions for TS2.9
I will try to get this into v3.0.0 of this library.

@ajafff ajafff added this to the v3.0.0 milestone Jul 4, 2018
@valera33
Copy link
Author

valera33 commented Jul 4, 2018

oh yes,I missed "2" in version problem in very last version : 2.27.2 and 2.27.1 is ok. I will update version on top.

@valera33 valera33 changed the title typescript 2.8 problem with 2.7.2 typescript 2.8 problem with 2.27.2 Jul 4, 2018
@ajafff
Copy link
Owner

ajafff commented Jul 4, 2018

After looking into it again there are some things wrong here: the change log states the function is available as of 2.26.0 (but it was internal in that release). It was exposed in 2.27.2 ... I totally missed that commit. It should have been a minor version instead. But all of this doesn't fix your problem.

@valera33
Copy link
Author

valera33 commented Jul 4, 2018

2.27.1 is working fine, I will use that one then, at least for now... project is pretty large, I cant use skipLibCheck

@ajafff ajafff closed this as completed in 1ab1cbe Jul 17, 2018
@ajafff
Copy link
Owner

ajafff commented Jul 17, 2018

This should be fixed in v2.28.0. A guide on how to get compatible declarations is now in the README.

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