Skip to content

[Bug?]: auto import doesn't always work with pnp? #6845

@kabo

Description

@kabo

Self-service

  • I'd be willing to implement a fix

Describe the bug

I'm using

  • yarn 4.9.2, pnp
  • neovim, lsp, ts_ls with typescript-language-server v4.3.4
  • typescript
  • I have run yarn dlx @yarnpkg/sdks base

In the example repo I can auto import PutObjectCommand no problems. I type PutObjectComm and PutObjectCommand is suggested, I hit enter and PutObjectCommand is auto imported.

But if I type new AaaaReco, AaaaRecord is suggested from the correct package, but when I hit enter it just completes the word. AaaaRecord is not auto imported.

To reproduce

See https://github.com/kabo/berry-import

Auto import works fine with the PutObjectCommand import, but not with AaaaRecord.

Environment

System:
    OS: Linux 6.14 Artix Linux
    CPU: (20) x64 13th Gen Intel(R) Core(TM) i9-13900H
  Binaries:
    Node: 24.3.0 - ~/.yarn/tmp/xfs-d49fc76b/node
    Yarn: 4.9.2 - ~/.yarn/tmp/xfs-d49fc76b/yarn
    npm: 9.8.1 - ~/n/bin/npm

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions