-
Notifications
You must be signed in to change notification settings - Fork 10
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
Problems in dependency resolution #13
Comments
Hm... do you a have repro case? I don't traverse non |
@andreypopp Consider such case: fake/auth.ts: // spelling mistake here
export function mocAuth() {
} fake/index.ts: export import auth = require("./fake/auth"); app.ts: import fake = require("./fake/index");
// You will not see the error here
fake.auth.mockAuth() Here we have |
Note that emit continues, because there are no errors in But the major problem is that it don't have the whole chain to type-check |
@s-panferov Hopefully this isn't in too bad of taste, but I solved this problem by just outsourcing all of this to the typescript compiler. That way it works identical to |
Hello @jbrantly. I saw your https://github.com/jbrantly/ts-loader and it's amazing! But I have tested it for the above scenario and it doesn't show errors too because the code is the same: https://github.com/jbrantly/ts-loader/blob/master/index.ts#L173-L174 var diagnostics = langService.getCompilerOptionsDiagnostics()
.concat(langService.getSyntacticDiagnostics(filePath))
.concat(langService.getSemanticDiagnostics(filePath)) You ask TS only for the current file diagnostics. Another big problem is the Maybe it can be done simpler by using TypeScript compiler? |
Hello @andreypopp. Thanks for the great library! I have been using it a little and I have found several big problems. The main problem right now is that is doesn't collect all the files that TypeScript needs. Consider this code from your library:
https://github.com/andreypopp/typescript-loader/blob/master/lib/TypeScriptWebpackHost.js#L177-L193
In this function you traverse only one level of the regular (non
.d.ts
) dependencies. But to compile the file TS needs the whole dependency tree to be loaded into the service.We don't see any errors because here you collect only current file diagnostics, but the actual errors are in the file deps.
Several days ago I have forked your library to awesome-typescript-loader and completely rewritten all the things there.
I wrote this issue because:
I added the info about your authorship into the README, but your project doesn't contain the LICENSE file so just say if you want me to add some additional copyright notice.
The text was updated successfully, but these errors were encountered: