Skip to content

Shared external module causes compiler to lockup #5695

Closed
@david-driscoll

Description

@david-driscoll

I have a very strange issue that I've finally figured out the cause of, as it's really very strange.

It appears that if there is a dependency, that exists in two locations, and it defines typings as external, then tsc gets confused and cannot reason about them both.

Setup

  • Using atom-typescript as my editor, though the issue shows up when trying to compile with tsc as well.
  • I'm on a windows machine.

My folder structure looks like:

  • c:\Dev\Omnisharp\omnisharp-atom
    • \node_modules\omnisharp-client symlink to c:\Dev\Omnisharp\omnisharp-node-client
    • \node_modules\@reactive\rxjs symlink to c:\Dev\reactivex\RxJS
  • c:\Dev\Omnisharp\omnisharp-node-client
    • \node_modules\@reactive\rxjs symlink to c:\Dev\reactivex\RxJS
  • c:\Dev\reactivex\RxJS

Everything is typically working great, I'm working on typings for RxJS 5.0, and updating omnisharp-client without issue.

When I got to omnisharp-atom an issue revealed itself, if I define Observable<T> as a return type for a method, with the above setup, then tsc get's confused and fails to compile. It gets into some sort of infinite loop.

Working

If I update things so that they look like:

  • c:\Dev\Omnisharp\omnisharp-atom
    • \node_modules\omnisharp-client (no symlink)
      • \node_modules\@reactive\rxjs (removed)
    • \node_modules\@reactive\rxjs symlink to c:\Dev\reactivex\RxJS

Then everything is happy and works as expected.

Without symlinks

If I update things so that they look like:

  • c:\Dev\Omnisharp\omnisharp-atom
    • \node_modules\omnisharp-client (no symlink)
      • \node_modules\@reactive\rxjs (symlink or non-symlink)
    • \node_modules\@reactive\rxjs symlink to c:\Dev\reactivex\RxJS

Then tsc fails to operate and will sit and consume CPU forever until it is killed.

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