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

Unable to resolve modules using Typescript 2.4.1 #565

Closed
stephensong opened this issue Jun 28, 2017 · 8 comments
Closed

Unable to resolve modules using Typescript 2.4.1 #565

stephensong opened this issue Jun 28, 2017 · 8 comments

Comments

@stephensong
Copy link

My project builds fine using ts-loader 2.2.0 with Webpack 2.4.1 and Typescript 2.3.4.

If I change to Typescript 2.4.1 however, it's a complete bust. It seems completely unable to resolve modules from the node_modules directory. Is there some secret sauce I'm missing?

(fwiw I was originally using ts-loader 2.0.3, but upgraded to 2.2.0 when I encountered this issue. When reverting back to ts 2.3.4 I left the ts-loader at 2.2.0 and it seemed to still be ok.)

Thanks.

ERROR in D:\dev\pseudoqurl\src\lib\contentHasher.ts
(31,25): error TS2307: Cannot find module 'crypto'.

ERROR in D:\dev\pseudoqurl\src\lib\contentHasher.ts
(32,53): error TS2307: Cannot find module 'fs'.

ERROR in D:\dev\pseudoqurl\src\lib\contentHasher.ts
(48,8): error TS2304: Cannot find name 'Buffer'.

ERROR in D:\dev\pseudoqurl\src\capuchin\tsconfig.json
error TS2688: Cannot find type definition file for 'jsonwebtoken'.

ERROR in D:\dev\pseudoqurl\src\capuchin\tsconfig.json
error TS2688: Cannot find type definition file for 'keygrip'.

ERROR in D:\dev\pseudoqurl\src\capuchin\tsconfig.json
error TS2688: Cannot find type definition file for 'koa'.

ERROR in D:\dev\pseudoqurl\src\capuchin\tsconfig.json
error TS2688: Cannot find type definition file for 'koa-bodyparser'.

ERROR in D:\dev\pseudoqurl\src\capuchin\tsconfig.json
error TS2688: Cannot find type definition file for 'koa-compose'.

ERROR in D:\dev\pseudoqurl\src\capuchin\tsconfig.json
error TS2688: Cannot find type definition file for 'koa-passport'.

ERROR in D:\dev\pseudoqurl\src\capuchin\tsconfig.json
error TS2688: Cannot find type definition file for 'koa-router'.

... and so on and so on.

@oliverguenther
Copy link

oliverguenther commented Jun 28, 2017

Seeing the same issue after upgrading to TypeScript 2.4.1 (on both ts-loader 2.0.2. and 2.2.0 same as @stephensong).

This is likely connected to microsoft/TypeScript#16772

@johnnyreilly
Copy link
Member

johnnyreilly commented Jun 28, 2017

Yup - looks to be a problem with TypeScript 2.4.1 as described by @oliverguenther. It might be the case that we need to make a change to support these changes which are due to land with TypeScript 2.5. Hopefully we can use the same approach as in ts-node:

TypeStrong/ts-node#366

Will leave this open as a reminder for now.

@jquintozamora
Copy link

I have the same issue,
Downgrading to TypeScript 2.4.0 solved my problem. But, indeed, that's a problem with @types.

@johnnyreilly
Copy link
Member

I think the remedy for this is pretty simple - see the link back to the ts-node PR for details. I'll take a look at this as soon as I can. I always say this and it bears repeating: PRs are always welcome!

@johnnyreilly
Copy link
Member

Okay - the fix is actually super simple and seems to work. I'll look to merge this in and release a new version of ts-loader as soon as I can.

gebner added a commit to leanprover/lean-client-js that referenced this issue Jun 28, 2017
@oliverguenther
Copy link

I can verify that this is fixed with a local npm linked version of ts-loader with your fix applied to it. I'm still seeing a number of new issues, but these all appear to be by design due to the stricter checks in 2.4.

Many thanks @johnnyreilly , not only for this fix but for your continued efforts.

@johnnyreilly
Copy link
Member

Great - thanks for testing @oliverguenther! I really appreciate that. 🌷

johnnyreilly added a commit that referenced this issue Jun 28, 2017
* Speculative fix for #565

* Added 2.4.1 to the build matrix

* Added 2.4.1 to the build matrix

* Update CHANGELOG.md
@johnnyreilly
Copy link
Member

2.2.1 has shipped!

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