Error on rxjs modules
Closed this issue · 10 comments
After including this library in my project and launching ng build or ng serve, I got these errors:
ERROR in ./node_modules/angular-material-fileupload/matFileUpload.esm.js
Module not found: Error: Can't resolve 'rxjs/observable/merge' in 'C:\myprojectt\node_modules\angular-material-fileupload'
ERROR in ./node_modules/angular-material-fileupload/matFileUpload.esm.js
Module not found: Error: Can't resolve 'rxjs/operators/startWith' in 'C:\myproject\node_modules\angular-material-fileupload'
I think this is due to your project referencing an outdated version of rxjs. In my project I'm using 6.2.1 which is the latest and it is compatible with Angular 6.
I'm facing the same issue:
[WDS] Errors while compiling. Reload prevented.
vendor.js:141454
./src/app/shared/shared.module.ts
vendor.js:141460
Module not found: Error: Can't resolve 'rxjs/add/operator/merge' in 'C:\ImperiumRepos\ImperiumUi\src\app\shared'
./node_modules/angular-material-fileupload/matFileUpload.esm.js
vendor.js:141460
Module not found: Error: Can't resolve 'rxjs/observable/merge' in 'C:\ImperiumRepos\ImperiumUi\node_modules\angular-material-fileupload'
./node_modules/angular-material-fileupload/matFileUpload.esm.js
vendor.js:141460
Module not found: Error: Can't resolve 'rxjs/operators/startWith' in 'C:\ImperiumRepos\ImperiumUi\node_modules\angular-material-fileupload'
Same here
Hello
Same issue.
I am on Angular 6 and RxJs 6.2.1
thanks for help
Hello,
Just change the imports in /node_modules/angular-material-fileupload/matFileUpload.esm.js
import { merge as merge$1 } from 'rxjs/observable/merge';
to
import { merge as merge$1 } from 'rxjs';
and
import { startWith as startWith$1 } from 'rxjs/operators/startWith';
to
import { startWith as startWith$1 } from 'rxjs';
All imports in the new rxjs version will be from 'rxjs' :)
You could install the rxjs-compat package from npm.
npm i rxjs-compat
It's designed for situations like this, where some code didn't migrate to rxjs 6 yet.
Dgiulian´s solution worked for me, thanks man :)
Just pushed 1.0.0 (angular 6), Please check.
Please try 1.0.1, 1.0.0 had some issues.
@matteo-mosca Did you get a chance to try the new version?
@matteo-mosca Closing this issue for now, Please let me know if you are still facing this issue.