Skip to content

Type resolution in linked packages #32970

Closed
@simonfox

Description

@simonfox

This is essentially a duplicate issue however there has been no response on the existing issues which have been incorrectly closed so I am opening again.

Related issues:
#29221
#29808

Merged PR which hasn't resolved the issue:
#31571

Problem occurs when using yarn link for development purposes.
Window 10 Pro v1903
Typescript 3.5.3
yarn 1.17.3

I've created a repro and described steps over on #29808 but basic steps are below

If you clone https://github.com/simonfox/repro-plugin-one and https://github.com/simonfox/repro-plugin-two and run yarn for both. Then run yarn link in plugin two root, and then link one to the local two with yarn link plugin-two from one. Then you will see the issue in src/features/feature-one/actions.ts (you may need to reload the VS Code window after linking).

This results in error TS2742: The inferred type of 'actions' cannot be named without a reference to 'drive-common/node_modules/typescript-fsa'. This is likely not portable. A type annotation is necessary.

image

UPDATE Should explicitly mention that this is in typings generation. With "declaration": false this error does not occur.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions