Aspnetcore-angular-universal: RROR in node_modules/rxjs/internal/types.d.ts(81,44): error TS1005: ';' expected.

Created on 31 Jan 2019  路  14Comments  路  Source: TrilonIO/aspnetcore-angular-universal

Just reporting this issue in case others experience the same problem with new installs when npm install.

2019-01-31T13:01:02.7557301Z     ERROR in node_modules/rxjs/internal/types.d.ts(81,44): error TS1005: ';' expected.
2019-01-31T13:01:02.7557613Z     node_modules/rxjs/internal/types.d.ts(81,74): error TS1005: ';' expected.
2019-01-31T13:01:02.7557888Z     node_modules/rxjs/internal/types.d.ts(81,77): error TS1109: Expression expected.

This happens because the latest rxjs version is no longer compatible with the typescript version we use for the starter ("~2.7.2"). Pinning the rxjs version from "^6.2.0" to "6.2.0" addresses the problem (apparently 6.3.3 should be OK according to the comments at https://stackoverflow.com/questions/54434333/error-ts1005-expected-typescript-angular-6-for-first-build-error-rxjs-insi)

Probably typescript should be upgraded to a higher version soon....

3rd party libraries External bug

Most helpful comment

@Ollynov remove the carat symbol (^) before the version number for rxjs. It worked for me and I also changed the version to 6.2.2

All 14 comments

Go to package.json

change rxjs to "rxjs": "6.0.0", and save

go to console and type

"npm update"

after that type

"ng serve"

  • Remove the "node_modules" folder from your project
  • Go to package.json
  • Change rxjs version to "rxjs": "6.3.3"
  • Go to console and run "npm install" again
  • And then run "ng serve"

It should work now !!

This worked for me. Thanks Rajnitha!

@amilathennakoon updated "rxjs": "^6.0.0" to "rxjs": "6.0.0" I get the below error

ERROR in node_modules/rxjs-compat/operator/shareReplay.d.ts(2,10): error TS2305: Module '"/export/appl/fqdprod/jenkins_rd/workspace/CI000000024053883/B2BGatewayUI/Build_Release_1.1/b2bgateway-ui/node_modules/rxjs/internal-compatibility/index"' has no exported member 'ShareReplayConfig'.

Below is the version of rxjs-compat from my package.json

"rxjs-compat": "^6.2.2"

Should I align the version of rxjs-compat based on the change made to rxjs version ? Please advice !

Coming to comment that the error
ERROR in node_modules/rxjs/internal/types.d.ts(81,44): error TS1005: ';' expected
exists for rxjs 6.5.0, however uninstalling that and installing @6.3.3 fixes the issue.

I continue to get the same error on any of those versions mentioned. (even after deleting node modules and installing again)

@Ollynov remove the carat symbol (^) before the version number for rxjs. It worked for me and I also changed the version to 6.2.2

This worked for me. Thanks.

does anyone knows whats happening under the hood

@RajithaAlluri ..This works for me as well thanks

i changed to below.

"rxjs": "6.2.2",
"rxjs-compat": "6.2.2",

@winfredchen thank you! This solution worked for me after a few hours of trying the other solutions.

Pushed to Master! Thanks for uncovering this one folks!! 馃檹

try without changing anything
npm install [email protected]
X.X.X -> you current version

Was this page helpful?
0 / 5 - 0 ratings

Related issues

peterdobson picture peterdobson  路  3Comments

michael-vasyliv picture michael-vasyliv  路  4Comments

rcanpahali picture rcanpahali  路  3Comments

digibum picture digibum  路  4Comments

consigliory picture consigliory  路  3Comments