Ivan-Mark Debono
Ivan-Mark Debono

Reputation: 16300

Build failing after upgrading to Angular 6

I just upgraded my Angular 5 project to 6. And build is failing with:

ERROR in node_modules/@ng-bootstrap/ng-bootstrap/datepicker/datepicker-service.d.ts(5,10): error TS2305: Module '"C:/myapp/node_modules/rxjs/Observable"' has no exported member 'Observable'.node_modules/@ng-bootstrap/ng-bootstrap/typeahead/typeahead.d.ts(3,10): error TS2305: Module '"C:/myapp/node_modules/rxjs/Observable"' has no exported member 'Observable'.node_modules/rxjs/Observable.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/Observable'.

Any ideas on how to solve this?

NOTE:

This problem occurs if adding ng-bootstrap to the project (even a new Angular 6 project).

Upvotes: 5

Views: 2081

Answers (3)

You can use v2.0.0 of ng-bootstrap which is now compatible with Angular 6. Update dependency in package.json:

"@ng-bootstrap/ng-bootstrap": "^2.0.0"

This way you don't need rxjs-compat, but make sure your code is RxJs 6 compatible. Also note the breaking changes of ng-bootstrap 2.0.0 release.

Upvotes: 1

Ivan-Mark Debono
Ivan-Mark Debono

Reputation: 16300

Do this:

npm install rxjs@6 rxjs-compat@6 --save

Upvotes: 9

Related Questions