Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular 5 ng build --prod fails #143

Open
lawliet616 opened this issue Nov 23, 2017 · 4 comments
Open

Angular 5 ng build --prod fails #143

lawliet616 opened this issue Nov 23, 2017 · 4 comments

Comments

@lawliet616
Copy link

Angular: 5.0.2
angular2-datatable: 0.6.0

When I run the ng build --prod command I get the following error:

ERROR in ./node_modules/rxjs/_esm5/observable/BoundCallbackObservable.js
Module build failed: TypeError: Cannot read property 'type' of undefined
...
 @ ./node_modules/rxjs/_esm5/observable/bindCallback.js 2:0-68
 @ ./node_modules/rxjs/_esm5/add/observable/bindCallback.js
 @ ./node_modules/rxjs/_esm5/Rx.js
 @ ./node_modules/angular2-datatable/lib/DataTable.js
 @ ./node_modules/angular2-datatable/lib/Paginator.js
 @ ./node_modules/angular2-datatable/lib/DataTableModule.js
 @ ./src/...module.ngfactory.js
 @ ./src/$$_lazy_route_resource lazy
 @ ./node_modules/@angular/core/esm5/core.js
 @ ./src/main.ts
 @ multi ./src/main.ts

The reason is probably that the project has bad rxjs imports, like:

import {Observable} from "rxjs/Rx";
import {map} from 'rxjs/operator/map';

with should be replaced by:

import {Observable} from 'rxjs/Observable';
import 'rxjs/add/operator/map';

Could you fix it?

@lawliet616
Copy link
Author

I found the bad line:
src/DataTable.ts 6. row

import {ReplaySubject} from "rxjs/Rx";
change that to
import {ReplaySubject} from "rxjs/ReplaySubject";

@markschmid
Copy link

@lawliet616 Did it work for you after changing the line? What else did you do to get it to work? It won't work for me. Tried npm rebuild, but to no avail...

@lawliet616
Copy link
Author

@markschmid I forked this project, fixed that line and now I'm using it this way in my package.json:

"angular2-datatable": "github:lawliet616/angular2-datatable"

Try it, it works for me.

@markschmid
Copy link

@lawliet616 Thanks! I tried but it won't work (same error). I've found that when I update typescript to 2.5, it works...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants