You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// tsconfig.json// FOR THIS BUG, ORDER MATTERS IN THE FILE ARRAY{"compilerOptions": {"target": "es5","module": "commonjs"},"files": ["foo/a.ts","foo/bar/b.ts"]}// foo/a.tsimport*asqfrom'qqq';// foo/bar/b.tsimport*asqfrom'qqq';// node_modules/qqq/index_.d.tsexport{}
The issue here is that when we do the lookup for qqq from foo/, we store the result that a lookup is known to fail. We track the list of failed lookup locations produced from this.
During the lookup of qqq from foo/bar/, we produce a smaller set of failed lookup locations, then go up a folder and see that we've already tried to resolve that module from that location, so we cut the search short. But we don't concatenate the list of failed lookup locations that the earlier search generated.
As a result, when node_modules/qqq/index.d.ts appears, we correctly identify that a.ts needs to have module resolution redone, but b.ts is still only waiting for foo/bar/node_modules/qqq to show up.
When this process happens in the other order, foo/ can't re-use the lookup results from foo/bar/ and the bug does not manifest.
Fix in progress is to store the failed lookup locations in the cache along with the lookup result.
TypeScript Version: 2.8.0-dev.20180318
Search Terms: watch mode subdirectory
Code
You'll need 4 files
Run
tsc -w
:Rename
index_.d.ts
toindex.d.ts
:Expected behavior: In the second compilation,
b.ts
should be able to correctly resolveqqq
.Actual behavior: Failure as shown above. Reversing the order of files in the
files
array produces the expected behavior.Playground Link: N/A
Related Issues: None?
The text was updated successfully, but these errors were encountered: