angularfire icon indicating copy to clipboard operation
angularfire copied to clipboard

TS2307: Cannot find module 'rxjs/subject/ReplaySubject'

Open mii9000 opened this issue 10 years ago • 2 comments

After integrating angularfire2 and running tsc I get the error: node_modules/angularfire2/providers/auth.d.ts(2,31): error TS2307: Cannot find module 'rxjs/subject/ReplaySubject'..

But if I simple change import { ReplaySubject } from 'rxjs/subject/ReplaySubject'; to import { ReplaySubject } from 'rxjs/Rx';.

Everything works fine. Is it just me or did someone else also encountered this problem?

mii9000 avatar Apr 24 '16 18:04 mii9000

You are probably using a beta version of rxjs newer than 5.0.0-beta.2, which has a slightly different folders structure. I think you should use

import { ReplaySubject } from 'rxjs/ReplaySubject'

instead of

import { ReplaySubject } from 'rxjs/subject/ReplaySubject'

kazkis avatar Apr 26 '16 10:04 kazkis

@kazkis Thank you for the reply. You are right, I was on beta5. I changed my package.json to keep in sync with current angular version and everything built fine.

mii9000 avatar Apr 26 '16 11:04 mii9000