When resolving from typings cache, handle node code modules #31820
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Earlier when first time we resolved things like "net", "stream" they would get added to the unresolved imports and typings installer would install the typing for node and project would get updated with it.
After this if one added import that doesn't resolve, we sent request to typings installer with unresolvedImport as that one and say it was invalid import, that would mean that the typings would come back as empty. At this point project would be invalidated and while resolving existing say "net" import in typings cache location we would lookup for "net.d.ts" and other such files which offcourse wont be there. That means now we have error resolving "net" import. But if this was another typing say like lodash it will resolve since it would find
lodash/index.d.ts
or some such file. So problem arises with these node core modules.The fix is to identify these module and lookup for "node" instead of "net" just like we do when we install typings when "net" is unresolved import.
Fixes #29865