ERROR in node_modules/rxjs/internal/types.d.ts(81,44): error TS1005: ‘;’ expected.

Bug Report

Current Behavior
There is a missing ‘;’ reported for types.d.ts

Date: 2019-02-07T20:57:38.886Z
Hash: d01965b30f3394f9889f
Time: 2174ms
chunk {main} main.js, (main) 1.93 kB [initial] [rendered]
chunk {polyfills} polyfills.js, (polyfills) 683 bytes [initial] [rendered]
chunk {runtime} runtime.js, (runtime) 5.22 kB [entry] [rendered]
chunk {styles} styles.js, (styles) 15.6 kB [initial] [rendered]
chunk {vendor} vendor.js, (vendor) 335 kB [initial] [rendered]

ERROR in node_modules/rxjs/internal/types.d.ts(81,44): error TS1005: ';' expected.
node_modules/rxjs/internal/types.d.ts(81,74): error TS1005: ';' expected.
node_modules/rxjs/internal/types.d.ts(81,77): error TS1109: Expression expected.```

Install Angular and NPM current versions.
ng new test
npm install
ng serve --host 
Output will show the error on the missing ';'

**Expected behavior**
Expect it to work and have the correction made for the missing semi-colon.

Angular CLI: 6.0.8
Node: 11.6.0
OS: darwin x64
Angular: 6.1.10
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package                           Version
@angular-devkit/architect         0.6.8
@angular-devkit/build-angular     0.6.8
@angular-devkit/build-optimizer   0.6.8
@angular-devkit/core              0.6.8
@angular-devkit/schematics        0.6.8
@angular/cli                      6.0.8
@ngtools/webpack                  6.0.8
@schematics/angular               0.6.8
@schematics/update                0.6.8
rxjs                              6.4.0
typescript                        2.7.2
webpack                           4.8.3

**Possible Solution**
<!--- Only if you have suggestions on a fix for the bug -->

9 thoughts on “ERROR in node_modules/rxjs/internal/types.d.ts(81,44): error TS1005: ‘;’ expected.

  1. The shareReplay spec saying

    should restart due to unsubscriptions if refCount is true

    is not wrong; it’s just not a complete – if you pardon the pun – description.

    Do shareReplay and publishReplay behave differently because of publishReplay using same ReplaySubject() instance as it is shown in source code ? and shareReplay({refCount: true}) re-creating new ReplaySubject instance every time

    Yes. The difference between publish – and its variants – and share is that publish passes a subject instance to multicast and share passes a factory.

    shareReplay is not implemented using multicast, but it uses a factory internally and if ref counted and the ref count drops to zero (without source completion) or if an error occurs, a new subject is created. The primary motivator for the difference in behaviour is so a source observable can be made hot and retriable. publish – and its variants – are not retriable, as they just replay the error.