Skip to content

importHelpers with symlinks breaks type resolution #29221

Closed
@stevefan1999-personal

Description

@stevefan1999-personal

TypeScript Version: 3.2.2

Search Terms:
type symlink importHelpers pnpm

Code
https://github.com/stevefan1999-personal/gqlify/tree/patch-pnpm-tslib

Reproduction:
This is a little bit complicated, you will need to clone the repo I provided and checkout the branch, then run pnpm install, and then please flip the importHelpers options to false and re-run the installation again.

Expected behavior:
When importHelpers is true, it shouldn't break type inference like we should when importHelpers is false.

Actual behavior:

error TS2742: The inferred type of '...' cannot be named without a reference to '...'. This is likely not portable. A type annotation is necessary.

When importHelpers is true and the @types directory is a symlink.

Related Issues:
pnpm/pnpm#1375

Extra Stuff:
Although it is application-specific (Lerna with NPM/Yarn works fine on this), I do think this should be handled correctly regardless of any layers of symlinks.

PS:
tsc output observation diff: http://www.mergely.com/a6N4kOW3/

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions