Skip to content

Intellisense not resolving modules when using exports in package.json #56412

Closed as not planned
@mjbvz

Description

@mjbvz

Reposting from VSCode repo for @magnusriga. I transferred the original issue to the wrong repo and now can't transfer it back


Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.84.2
  • OS Version: Windows 11 Pro

Steps to Reproduce:

  1. Build any project (A) with a dependency on another project (B), where project B's package.json exports files using the exports field
  2. Observer how Intellisense does not work
  3. Insert the main and types fields and see that Intellisense starts working again

Intellisense Works When main and types are set:

Package B's package.json

image

Package A's import (notice the Intellisense pop-up. It is possible to ctrl-click the path.)

image

Intellisense Does Not Work When only exports is set:

Package B's package.json (removed main and types)

image

Package A's import (not possible to crl+click to find the package, i.e. no Intellisense)

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs More InfoThe issue still hasn't been fully clarified

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions