Skip to content

VSCode does not provide suggestions/auto-complete for NPM package installed as a dependency of another #55594

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
paul-uz opened this issue Aug 17, 2023 · 4 comments
Labels
Duplicate An existing issue was already created

Comments

@paul-uz
Copy link

paul-uz commented Aug 17, 2023

I have my own "SDK" package which has a dependency of a popular ORM package.

I can installed my SDK package in a project, and I can import the ORM package and use it, however, autocomplete, and suggestions when i write a method belonging to the ORM hasn't yet been imported, simply do not work, unless I add the ORM package explicitly to my projects package.json, which seems a bit redundant?

Is there anything I can add to my project package.json file to get it working?

@IllusionMH
Copy link
Contributor

I think it's intended behavior - dependencies specify which packages are required by app/package, but their transitive dependencies are implementation detail and consumers should not rely on them, as they can be removed/updated to new major/replaced in any deoendency update.

In your case you should add it to package.json to make your intent explicit, re-export subset of ORM API from SDK to control what consumers should have access to, use it as peerDependencies in SDK if consumers are expected to use ORM anyway.

@mjbvz mjbvz transferred this issue from microsoft/vscode Aug 31, 2023
@mjbvz mjbvz removed their assignment Aug 31, 2023
@andrewbranch
Copy link
Member

Duplicate of #38768

@andrewbranch andrewbranch marked this as a duplicate of #38768 Sep 1, 2023
@andrewbranch andrewbranch added the Duplicate An existing issue was already created label Sep 1, 2023
@typescript-bot
Copy link
Collaborator

This issue has been marked as "Duplicate" and has seen no recent activity. It has been automatically closed for house-keeping purposes.

@typescript-bot typescript-bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 4, 2023
@mrleblanc101
Copy link

It would be nice ot have an option to not filter sub-dependencies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

6 participants