Skip to content

TSC fails with "Out of Memory" when using rx.js Observable.empty() in a certain way #8143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
eyalellenbogen opened this issue Apr 18, 2016 · 1 comment
Labels
External Relates to another program, environment, or user action which we cannot control.

Comments

@eyalellenbogen
Copy link

TypeScript Version:

1.8.10 (haven't tested others)

Reproduce
To reproduce, download my sample app from here https://onedrive.live.com/redir?resid=D21E8187512929BF!618745&authkey=!AIy8PGTFM15HoiI&ithint=file%2czip
run 'npm install'
then 'typings install'
then 'tsc -w'

The problem is with line 19 in app/src/app/api/ApiService.ts. When commenting out this line tsc works as expected and transpiles it within a few short seconds. When uncommenting it, tsc will take more than 15 seconds to compile and sometime even crash with an "Out of Memory" exception.
The problem seems to be specifically with the empty method under Observable from rxjs.
A workaround, as noted in line 18, is to use the generic form of the empty method and write 'Rx.Observable.empty()' instead. Another thing to notice is if we use Rx.Observable.empty() in a different file in the project there seems to be no problem. I could only reproduce this crash with this specific structure.

Expected behavior:
tsc should compile as usual

Actual behavior:
tsc hangs for 15-20 seconds (depends on the size of the app) and sometimes crashes with an "Out of Memory" exception.

@vladima
Copy link
Contributor

vladima commented Apr 18, 2016

this is a known issue with [email protected], on my box upgrading to beta-3 drops the compilation time from ~10s to ~1s

@mhegazy mhegazy added the External Relates to another program, environment, or user action which we cannot control. label Apr 18, 2016
@mhegazy mhegazy closed this as completed May 20, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
External Relates to another program, environment, or user action which we cannot control.
Projects
None yet
Development

No branches or pull requests

3 participants