microsoft / microsoft/TypeScript

VSCode Angular 11 custom shared library auto-import suggestions are wrong

Open
#42,878 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Needs Investigation
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

Bug Report

I'm trying to follow the Angular tutorial to use shared libraries: https://angular.io/guide/creating-libraries#creating-libraries

According to this section in the tutorial I am supposed to import the service like below but it is not suggested in the prompt:

import { CustomLibService } from "custom-lib";

When I try to import a shared service the quick fix suggests wrong import paths:
image

Auto import doesn't help either:

image

Possibly related to #37222

🔎 Search Terms

angular, custom library, auto-import, vscode, visual studio code

🕗 Version & Regression Information

C:>code --version
1.53.2
622cb03f7e070a9670c94bae1a45d78d7181fbd4
x64

C:>node --version
v12.18.4

Typescript: 4.1.2
Angular: 11.2.1

⏯ Playground Link

Github repo

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked GitHub reproduction repository and verify the behavior using VS Code 1.53.2, TypeScript 4.1.2, and Angular 11.2.1. Trace the auto-import and quick-fix behavior for the shared library; done means both suggestions offer the package import custom-lib rather than incorrect paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript, vscode
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.