-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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 type definition file for 'node'." for 2.4.1 #16772
Comments
Try using |
We are having the same problem, but it only seems to surface when running mocha with |
Same issue here with ts-node/register. Fails to find all imported @types modules. I have reverted back to 2.3.4. |
Ditto |
I've been debugging for the past 2.5 hours. Thank you for this issue. I was going insane. |
Having the same issue, but for several other type definition files including angular, angular-material, and more. Had to revert back to 2.3.4. |
I think this is also an issue with ts-loader. 'tsc -p .' works fine but as of this upgrade,
(which is kinda weird because it looks like it built everything successfully before it errors out with this??) Rolling back to 2.3.4 and the problem is gone. |
similar issue: teppeis/typescript-simple#82 |
Having similar issues with type definitions. (node, jquery...) enforced typescript version 2.4.0 using npm-shrinkwrap as a workaround
|
Having same issues with all of our type definitions, which are:
|
Same problem here. |
I had similar problems with ts-node, but tsc -p was fine. Upgrading to v3.1.0 fixed the problem. |
@skseth bumping ts-node seems to fix the issue for me too. I was on 3.0.6 -> 3.1.0 has done the trick. It looks like this change TypeStrong/ts-node#366 that they seem to be expecting in TypeScript 2.5 made it out early. |
Can I summarise this?
|
I've had this problem too using webpack and ts-loader when upgrading to TypeScript 2.4.1. In my case, I start webpack with the I've managed to fix this by modifying the
|
I had this problem when upgrading to Typescript 2.4.1. I separate webpack with my project. it means that typescript has different module paths with @types file. |
IMHO, new TypeScript releases should be tested against some simple Webpack projects that use ts-loader and ts-node (and also against DefinitelyTyped type definitions) before being published on npm. TypeScript is not just github.com/Microsoft/TypeScript anymore, it became a whole ecosystem that needs to be kept in sync and tested |
Actually I see it as the responsibility of these downstream projects to be ready for TypeScript. vscode integrates to The TypeScript team already goes over most of the DefinitelyTyped and there were quite a few patches made prior to the release of 2.4, though DefinitelyTyped is a community project. |
It is not illogical. Rust does this: with every release of the language, they make sure that all the projects in their package manager still compile. This feature makes the language very robust and trustworthy. I'm not saying this is the approach to follow by TypeScript, but certainly including some common setups among the tests would make troubleshooting backwards-incompatible problems much easier. It's just a matter of being able to provide an extensive breaking changes list. |
Just made a tweak to ts-loader which seems to resolve the issue. Thought it was probably worth sharing here for any other project maintainers who've been bitten: TypeStrong/ts-loader#566 I'm planning to release this as soon as I get a moment. FWIW I only heard about this today thanks to @donaldpipowitch helpful mention of me in this issue. |
What do they do when it doesn't? |
For the moment they just promise backwards compatibility. (I must clarify that I'm not into Rust at all. I think it's a language with very interesting ideas and heard some talks on it and know a bit about its syntax, but that's about it.) |
Well, TypeScript doesn't between minor revisions, just patch revisions. So just making sure everything everywhere compiles wouldn't be valid. |
2.4.0 was on June 6 and 2.4.1 was on June 27. I don"t see any major changes to module resolution in that span. More likely something about the way we deal with the host in the services layer changed. It would nice to have a simple reproducible example that I could test out on the different TypeScript versions in that short time span to try and find out what happened. I can't reproduce this with just The only releases in that span were: 2.4.0
2.5.0-dev.20170613
2.5.0-dev.20170614
2.5.0-dev.20170615
2.5.0-dev.20170616
2.5.0-dev.20170617
2.5.0-dev.20170618
2.5.0-dev.20170619
2.5.0-dev.20170621
2.5.0-dev.20170622
2.5.0-dev.20170623
2.5.0-dev.20170624
2.5.0-dev.20170625
2.5.0-dev.20170626
2.5.0-dev.20170627
2.4.1 |
Watching this... Have the same issue with @types/angular, using ts-loader with webpack |
My project is using Node + Typescript + Webpack + I fixed mine by switching to I can still use |
Thank you all for solving this. |
@rbuckton Updated
The same project works fine on |
@stephen Wow, that's true. Seems that typescript not supports imports like |
Fixes jrieken#62 **Bug** TS 2.4 changes the builder logic, which blocks building vscode using gulp-tsb: microsoft/TypeScript#16772 **Fix** Add missing methods as suggested by: https://github.com/TypeStrong/ts-loader/pull/566/files
Reverted typescript from version 2.4.1 to 2.2.2 in package.json: |
For what it's worth, upgrading |
For TypeScript 2.4.2 if you already have some custom You need to add Backstory: I had this problem because I use WebStorm IDE which uses |
@serbanghita you are the MVP here. Just note that the |
I have a TypeScript app which imports another TypeScript app and I am receiving
I checked The config of "wire-webapp-cryptobox.d.ts" looks as follows: {
"compilerOptions": {
"declaration": false,
"lib": ["es7", "dom"],
"module": "commonjs",
"moduleResolution": "node",
"noEmitOnError": true,
"noImplicitAny": false,
"noImplicitReturns": true,
"removeComments": true,
"sourceMap": false,
"target": "es5"
},
"exclude": [
"bower_components",
"node_modules",
"typings/browser",
"typings/browser.d.ts"
]
} Can you tell me where I need to set |
@bennyn TypeScript won't be looking at any |
TypeScript Version: 2.4.1
Code
https://github.com/Mercateo/ws/tree/v2
Diff
yarn.lock
:Expected behavior:
Compile.
Actual behavior:
The text was updated successfully, but these errors were encountered: