mariuszfoltak/angular2-datatable

compiling to production with aot not working in angular 5

Opened this issue · 11 comments

ERROR in ../node_modules/rxjs/_esm5/observable/BoundNodeCallbackObservable.js
Module build failed: TypeError: Cannot read property 'type' of undefined
at Object.getEffectiveTypeAnnotationNode (/home/xavi/Code2/bkmdoc-frontend/node_modules/typescript/lib/typescript.js:9341:17)
at assignContextualParameterTypes (/home/xavi/Code2/bkmdoc-frontend/node_modules/typescript/lib/typescript.js:41652:25)
at checkFunctionExpressionOrObjectLiteralMethod (/home/xavi/Code2/bkmdoc-frontend/node_modules/typescript/lib/typescript.js:41948:29)
at checkExpressionWorker (/home/xavi/Code2/bkmdoc-frontend/node_modules/typescript/lib/typescript.js:42959:28)
at checkExpression (/home/xavi/Code2/bkmdoc-frontend/node_modules/typescript/lib/typescript.js:42898:42)
at checkExpressionCached (/home/xavi/Code2/bkmdoc-frontend/node_modules/typescript/lib/typescript.js:42779:38)
at checkReturnStatement (/home/xavi/Code2/bkmdoc-frontend/node_modules/typescript/lib/typescript.js:45418:54)
at checkSourceElement (/home/xavi/Code2/bkmdoc-frontend/node_modules/typescript/lib/typescript.js:46763:28)
at Object.forEach (/home/xavi/Code2/bkmdoc-frontend/node_modules/typescript/lib/typescript.js:1506:30)
at checkBlock (/home/xavi/Code2/bkmdoc-frontend/node_modules/typescript/lib/typescript.js:44563:16)
at checkSourceElement (/home/xavi/Code2/bkmdoc-frontend/node_modules/typescript/lib/typescript.js:46742:28)
at checkFunctionExpressionOrObjectLiteralMethodDeferred (/home/xavi/Code2/bkmdoc-frontend/node_modules/typescript/lib/typescript.js:41990:21)
at checkDeferredNodes (/home/xavi/Code2/bkmdoc-frontend/node_modules/typescript/lib/typescript.js:46828:25)
at checkSourceFileWorker (/home/xavi/Code2/bkmdoc-frontend/node_modules/typescript/lib/typescript.js:46863:17)
at checkSourceFile (/home/xavi/Code2/bkmdoc-frontend/node_modules/typescript/lib/typescript.js:46842:13)
at Object.forEach (/home/xavi/Code2/bkmdoc-frontend/node_modules/typescript/lib/typescript.js:1506:30)
@ ../node_modules/rxjs/_esm5/observable/bindNodeCallback.js 2:0-76
@ ../node_modules/rxjs/_esm5/add/observable/bindNodeCallback.js
@ ../node_modules/rxjs/_esm5/Rx.js
@ ../node_modules/angular2-datatable/lib/DataTable.js
@ ../node_modules/angular2-datatable/lib/BootstrapPaginator.js
@ ../node_modules/angular2-datatable/lib/DataTableModule.js

Also happening for me. This appears to be an issue with RX.

PS C:\an\interact-frontend> ng version

_                      _                 ____ _     ___

/ \ _ __ __ _ _ | | __ _ _ __ / | | | |
/ △ \ | '
\ / _ | | | | |/ _ | '
| | | | | | |
/ ___ | | | | (
| | || | | (| | | | || | | |
// __| ||_, |_,||_,|| _|||
|___/

Angular CLI: 1.5.0
Node: 6.9.1
OS: win32 x64
Angular: 5.0.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.5.0
@angular-devkit/build-optimizer: 0.0.32
@angular-devkit/core: 0.0.20
@angular-devkit/schematics: 0.0.35
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.0
@schematics/angular: 0.1.0
typescript: 2.4.2
webpack: 3.8.1

import { Observable } from 'rxjs/Rx' need to be replaced with import { Observable } from 'rxjs/Observable' in Angular5

@msaricaclf Does not work for me

Not working for me its already import { Observable } from 'rxjs/Observable '

Not working for me with the fix mentioned.

import { Observable } from 'rxjs/Observable '

cm0s commented

Have you tried updating to typescript version ^2.6.1?
Modify it in your package.json and rerun a npm install

Updating to 2.6.1 and re-running npm install worked for me.

@FherNando thanks! Updating to 2.6.1 did the trick.

Thank you.. updated to 2.6.1 in the devDependencies worked for me.

"devDependencies": {
"@angular/cli": "^1.7.2",
"@angular/compiler-cli": "^5.2.0",
"@angular/language-service": "^5.2.0",
"@types/file-saver": "^1.3.0",
"@types/jasmine": "~2.8.3",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"codelyzer": "^4.0.1",
"jasmine-core": "~2.8.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~2.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"ng-packagr": "^1.7.0",
"npm-assets": "^0.1.2",
"protractor": "^5.3.2",
"ts-node": "~4.1.0",
"tslint": "~5.9.1",
"typescript": "^2.6.1"
}