-
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
Add fix for webpack history merge bug #29339
Conversation
@weswigham thank you! After adding a non-empty check for |
Wouldn't it mean |
Yep, |
Could it be order of resolution and visible through webpack because it probably does not use sourceFile order to get errors? May be trying through editor kind of scenario where the errors are requested for the interface before sourceFile can find the issue? |
@weswigham would it help to look at the call stack? I assume it's pretty easy to create a reference whose valueDeclaration has no parent and that the problem is that it normally doesn't make it into getTypeReferenceTypeWorker. |
@weswigham Found the repro for this while investigation of #29661 where ts-loader changes the order of files as the root files (history node typing before lib file) resulting in this error. The simplified repro is //@filename: /other.d.ts
export as namespace SomeInterface;
export type Action = 'PUSH' | 'POP' | 'REPLACE';
//@filename: /main.ts
interface SomeInterface {
readonly length: number;
}
const value: SomeInterface; |
@sheetalkamat I've added your test to this PR. |
This fixes history problem. More info here microsoft/TypeScript#28810. It was fixed here microsoft/TypeScript#29339 with version 3.4.x
Fixes #28810, probably. I can't isolate a repro without webpack and a whole lot of other stuff (lodash, @type/histroy, react, more things that i'm not really sure about), but I've confirmed that this fixes @wanliyunyan's repro.