Skip to content

Multiple projects linked by npm link do not compile properly within vscode #9585

Closed
@kayahr

Description

@kayahr

TypeScript Version: 2.0.0-dev.20160707
VSCode Version: 1.3.0
OS Version: Debian GNU/Linux 8.5

This issue is related to #6365 which is fixed in TypeScript 2.0 but for some reason it can still be reproduced in vscode configured to use TypeScript 2.0.

Steps to reproduce:

  1. Globally install TypeScript 2.0 with "npm install -g typescript@next"

  2. Install vscode 1.3.0

  3. Configure vscode to use the globally installed TypeScript 2.0 by setting the typescript.tsdk path in the user settings.

  4. Unpack the projects.zip
    archive somewhere.

  5. Run npm link in projects/base.

  6. Run npm link base in projects/ui.

  7. Run npm link in projects/ui.

  8. Run npm link base in projects/application.

  9. Run npm link ui in projects/application.

  10. Run tsc in projects/application and notice that it compiles correctly.

  11. Now open projects/application in vscode and open the file src/main/Impl.ts. The following error is displayed:

    Class 'TestImpl' incorrectly implements interface 'Test'.
      Types of property 'getPoint' are incompatible.
        Type '() => Point' is not assignable to type '() => Point'.
          Type 'Point' is not assignable to type 'Point'.
            Types have separate declarations of a private property 'x'.
    
  12. Press Ctrl-Shift-B to compile the project with the command line compiler. The error disappears.

  13. Edit the file (inserting a whitespace for example) and the error re-appears.

So while the project compiles fine on the command line (Running tsc directly) it doesn't compile within vscode which uses the exact same compiler.

Here is a screenshot of the error message:

screenshot

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions