0

I'm using angular 8 and when I'm running the code these errors are appear. how to solve this ?

why these error are appear? Can anyone explain this?

** ERROR in Debug Failure. False expression.

ERROR in node_modules/rxjs/Subject.d.ts:1:15 - error TS2307: Cannot find module 'rxjs-compat/Subject' or its corresponding type declarations.

1 export * from 'rxjs-compat/Subject';
                ~~~~~~~~~~~~~~~~~~~~~
node_modules/@angular/material/core/typings/common-behaviors/error-state.d.ts:11:10 - error TS2305: Module '"../../../../../rxjs/Subject"' has no exported member 'Subject'.

11 import { Subject } from 'rxjs/Subject';
            ~~~~~~~
node_modules/rxjs/Observable.d.ts:1:15 - error TS2307: Cannot find module 'rxjs-compat/Observable' or its corresponding type declarations.

1 export * from 'rxjs-compat/Observable';
                ~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@angular/material/core/typings/common-behaviors/initialized.d.ts:9:10 - error TS2305: Module '"../../../../../rxjs/Observable"' has no exported member 'Observable'.

9 import { Observable } from 'rxjs/Observable';
           ~~~~~~~~~~
node_modules/@angular/material/core/typings/datetime/date-adapter.d.ts:9:10 - error TS2305: Module '"../../../../../rxjs/Observable"' has no exported member 'Observable'.

9 import { Observable } from 'rxjs/Observable';
           ~~~~~~~~~~
node_modules/@angular/material/core/typings/datetime/date-adapter.d.ts:10:10 - error TS2305: Module '"../../../../../rxjs/Subject"' has no exported member 'Subject'.

10 import { Subject } from 'rxjs/Subject';
            ~~~~~~~
node_modules/@angular/material/core/typings/option/option.d.ts:1:10 - error TS2305: Module '"../../../../../rxjs/Subject"' has no exported member 'Subject'.

1 import { Subject } from 'rxjs/Subject';
           ~~~~~~~
node_modules/@angular/material/form-field/typings/form-field-control.d.ts:8:10 - error TS2305: Module '"../../../../rxjs/Observable"' has no exported member 'Observable'.

8 import { Observable } from 'rxjs/Observable';
           ~~~~~~~~~~
node_modules/@angular/material/input/typings/input.d.ts:6:10 - error TS2305: Module '"../../../../rxjs/Subject"' has no exported member 'Subject'.

6 import { Subject } from 'rxjs/Subject';
           ~~~~~~~
node_modules/@angular/material/select/typings/select.d.ts:16:10 - error TS2305: Module '"../../../../rxjs/Observable"' has no exported member 'Observable'.   

16 import { Observable } from 'rxjs/Observable';
            ~~~~~~~~~~
3
  • Does this answer your question? Cannot find module 'rxjs-compat/Observable' Commented Oct 5, 2020 at 8:52
  • yes I tried but not working . is this issue related to version?? Commented Oct 5, 2020 at 11:05
  • rxjs-compat is used as a workaround for migration from v5 to newer. I think you should consider refactoring your code to use rxjs instead of rxjs-compat. This article might help Commented Oct 5, 2020 at 11:52

3 Answers 3

1

It is due to mismatching of the version you downloaded and the angular version. You have to choose whether it is suitable or not to the angular version you use..

Sign up to request clarification or add additional context in comments.

Comments

0

Try this

npm install rxjs-compat --save

3 Comments

Try - import { Observable } from 'rxjs'
yes I tried but still same error .. is this error related to version ?
Please add some explanation to your answer such that others can learn from it
0

You need to import classes from rxjs like so:

import { Observable, Subject } from "rxjs";

Why? rxjs changed their export layout to use a single export file instead of using paths to specify dependency locations.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.