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.
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, thentscgets confused and cannot reason about them both.Setup
tscas well.My folder structure looks like:
c:\Dev\Omnisharp\omnisharp-atom\node_modules\omnisharp-clientsymlink toc:\Dev\Omnisharp\omnisharp-node-client\node_modules\@reactive\rxjssymlink toc:\Dev\reactivex\RxJSc:\Dev\Omnisharp\omnisharp-node-client\node_modules\@reactive\rxjssymlink toc:\Dev\reactivex\RxJSc:\Dev\reactivex\RxJSEverything is typically working great, I'm working on typings for RxJS 5.0, and updating
omnisharp-clientwithout issue.When I got to
omnisharp-atoman issue revealed itself, if I defineObservable<T>as a return type for a method, with the above setup, thentscget'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)(removed)\node_modules\@reactive\rxjs\node_modules\@reactive\rxjssymlink toc:\Dev\reactivex\RxJSThen 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\rxjssymlink toc:\Dev\reactivex\RxJSThen
tscfails to operate and will sit and consume CPU forever until it is killed.