TypeScript Auto-Import Fails for Workspace Package in ESM Monorepo with Project References and Specific Dependencies
Does this issue occur when all extensions are disabled?: Yes
Version: 1.99.3
V8: 13.2.152.41-electron.0
OS: Linux x64 6.8.0-57-generic
Link to Minimal Reproduction Repository: https://github.com/hosseinalipour/suggestion-reproduction.git
Problem Description:
In a Yarn 1.x monorepo configured for ES Modules ("type": "module" in root package.json, using TypeScript project references and path aliases, auto-import suggestions for exported symbols from a local workspace package (@abc/utils) do not appear when typing the symbol name in another local package (@abc/myapp).
A key observation is that auto-import functionality works as expected if the dependencies section in the relevant package.json is empty. However, when the specified project dependencies are present, the auto-import feature fails. This suggests an issue with how dependencies are processed or how the module graph is built by the TypeScript language service in this configuration.
I'm providing this detailed report and a minimal reproduction in the hope it can be investigated. While I've confirmed this occurs with extensions disabled, I'm uncertain if the root cause lies directly within VS Code, the TypeScript language service, or a subtle misconfiguration on my part. Any guidance or pointers would be appreciated.
Steps to Reproduce:
Clone the provided minimal reproduction repository.
Launch Vscode by mkdir ~/.temp && code --disable-extensions --profile ~/.temp/profile --user-data-dir ~/.temp/user_data .
Run yarn install (or your package manager's install command) from the workspace root.
Open packages/myapp/index.ts.
Begin typing "delay" (which is exported from utils/index.ts.
Expected Behavior: IntelliSense should suggest delay and offer to auto-import it from @abc/utils. Selecting the suggestion should add the import statement.
Actual Behavior: No auto-import suggestion for delay from @abc/utils appears in the completion list. Manual imports may work, but the discovery and auto-import feature fails.
See https://github.com/Microsoft/TypeScript/wiki/FAQ#auto-import-heuristics-and-preferences
This issue has been marked as "Question" and has seen no recent activity. It has been automatically closed for house-keeping purposes.