-
Notifications
You must be signed in to change notification settings - Fork 130
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
gulp-typescript doesn't resolve @types in outter node_modules #563
Comments
Ups. Just saw #515 and the solution was just to do Thanks anyway! |
Nope, didn't work after all (just didn't do anything in the end because the |
I haven't used yarn workspaces myself, so I'm not familiar with those. Could you create a basic example that illustrates the problem, which I can clone and install to see the bug? |
Is this still an issue? |
Sorry, I was quite busy. I'll test it once I have a little time at the end of september and will create that basic example for you! Thanks for your patience :) |
@ivogabe it is. Trying to migrate an old project and can't get my head around this. Works if add symbolic link for |
@ivogabe Alright, I finally managed to create a test case: just do yarn install
npm run build-gulp
npm run build-tsc I tested it on windows, not sure if the As you see Thanks a lot! |
@ivogabe any update on this? Thanks! |
OK, I digged a lot and found the problem. For whatever reason typescript does not traverse the parent The problem lies in main.ts#222. Just remove Thank you very much! |
I just had the same problem... took me quite a long (and frustrating) time to test options and search for solutions, but I eventually found this issue. Thanks @FunkMonkey for logging it! |
Another solution is to use yarn nohoist feature with "**/@types/**" pattern, on the root project. It would be great if this issue was fixed. It could avoid to a lot of people to spend a lot of hours to find why theirs projects are not building, and how to fix it. |
Fixes ivogabe#563 The fix is actually the change in main.ts. The same change was applied to project.ts though I've not found a way to create a test case that generates there. (It may not be currently possible to generate such a case.) It just seems that the two calls to parseJsonConfigFileContent should pass the whole path to the config.
Sorry for the late reply. Thanks @FunkMonkey for the debugging! @lddubeau has opened a PR, I'll review that tomorrow. So we'll have this issue fixed soon! |
Expected behavior:
With a project structure like this, which uses Yarn workspaces
there should not be compiler errors like
error TS2304: Cannot find name 'require'.
orerror TS2688: Cannot find type definition file for 'node'.
(after addingnode
totypes
intsconfig.json
.Actual behavior:
Getting
error TS2304: Cannot find name 'require'.
Your gulpfile:
tsconfig.json
Code
Just using
tsc
works flawlessly, so it must be something insidegulp-typescript
!The text was updated successfully, but these errors were encountered: