Description
For some unknown reason, I'm getting wrong suggested imports in a certain scenario. I'm working in a mono repo with yarn workspaces. I have a package that depends on another package from the monorepo. The package I'm depending on (package-a
) has a export from the main file. In the other package (package-b
) I have a file that imports from package-a
. But then when I'm trying to do an import from two relative files in package-b
I'm getting a wrong import (like shown). But when I remove the import from package-a
from the file in package-b
I'm getting the correct import suggestion.
TypeScript Version: 3.1.0-dev.20180728
Search Terms:
wrong import suggestion
no relative import suggestion
Code
A link to a github repo with a reproduction
Steps to reproduce:
git clone
andyarn
- run
yarn build
insidepackages/package-a
- open vscode and navigate to
packages/package-b/src/another.ts
. - open the import suggestion for
C
. Wrong import is shown. - Go to file
packages/package-b/src/index.ts
- Comment the first line (the import)
- Go to file
packages/package-b/src/another.ts
- Open the import suggestion. correct import is shown
Expected behavior:
Suggest import on a file trying to import from another relative file should be:
Actual behavior:
Instead the import is suggested with the name of module and the src folder