You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Look for import { Observable } from 'rxjs/Rx' in your project and replace it with import { Observable } from 'rxjs/Observable'
Reacted by Fouad Chamoun, Marius, Code Scratcher, Szymon Bartnik, JayChase, papaiatis, Ray Suelzer, Ray Luxembourg, oceania, PeS82 and 55 more
Reacted by AJ Zane, finalxcode, Vehans Ayvazi, JamesDevGit, ruslanki, Martin Jul Hammer, Fernando Herrera, emiyake, Sebastián Ferreras, Sanjay Achar and 4 more
Reacted by Fouad Chamoun, Marius, Ray Suelzer, oceania, Ralf Saenen, Joseph Brasch, Michael Trouw, Jack Koppa, SquadWuschel, Vehans Ayvazi and 11 more
Hello, we reviewed this issue and determined that it doesn't fall into the bug report or feature request category. This issue tracker is not suitable for support requests, please repost your issue on StackOverflow using tag angular.
If you are wondering why we don't resolve support issues via the issue tracker, please check out this explanation.
Reacted by HeroBart, Marius, Katsumi Honda, Sebastián Ferreras, Jack Koppa, Taylor LaMar and Akshay Vijay Jain
Updating typescript to 2.6.1 will fix this issue, but we will have warning message as below
@angular/[email protected] requires typescript@'>=2.4.2 <2.5.0' but 2.6.1 was found instead.
Using this version can result in undefined behaviour and difficult to debug problems.
Please run the following command to install a compatible version of TypeScript.
npm install typescript@'>=2.4.2 <2.5.0'
To disable this warning run "ng set warnings.typescriptMismatch=false".
Reacted by Kayes Islam, Lincoln Baxter, III, km, Rui Sebastiao, Nicholas Westley, Vladan K. Stojanović, Leonardo Vidal, Pasquale Lisena, Nastya-Piu, Taurus Omejia and 4 more
Reacted by km
Reacted by Emir Mamashov, Pasquale Lisena and Matt Thiessen
I can also confirm that using the bindCallback operator on Observable will cause production build errors, unless TypeScript is upgraded above the "supported" version. It is not enough to simply upgrade global TypeScript to 2.6.1, also make sure you upgrade package.json or it won't work.
// Import example
import 'rxjs/add/observable/bindCallback';
I have the same error .. I am using .. Should I import import "rxjs" ?
import { timeout } from 'rxjs/operator/timeout';
import { map } from 'rxjs/operator/map';
Error: ./node_modules/rxjs/observable/BoundNodeCallbackObservable.js
Module build failed: TypeError: Cannot read property 'type' of undefined
at Object.getEffectiveTypeAnnotationNode (D:\tmp\ionic2\ezpart-mobile-svn\no
de_modules\typescript\lib\typescript.js:9341:17)
at assignContextualParameterTypes (D:\tmp\ionic2\ezpart-mobile-svn\node_modu
les\typescript\lib\typescript.js:41652:25)
at checkFunctionExpressionOrObjectLiteralMethod (D:\tmp\ionic2\ezpart-mobile
-svn\node_modules\typescript\lib\typescript.js:41948:29)
at checkExpressionWorker (D:\tmp\ionic2\ezpart-mobile-svn\node_modules\types
cript\lib\typescript.js:42959:28)
at checkExpression (D:\tmp\ionic2\ezpart-mobile-svn\node_modules\typescript\
lib\typescript.js:42898:42)
at checkExpressionCached (D:\tmp\ionic2\ezpart-mobile-svn\node_modules\types
cript\lib\typescript.js:42779:38)
at checkReturnStatement (D:\tmp\ionic2\ezpart-mobile-svn\node_modules\typesc
ript\lib\typescript.js:45418:54)
at checkSourceElement (D:\tmp\ionic2\ezpart-mobile-svn\node_modules\typescri
pt\lib\typescript.js:46763:28)
at Object.forEach (D:\tmp\ionic2\ezpart-mobile-svn\node_modules\typescript\l
ib\typescript.js:1506:30)
at checkBlock (D:\tmp\ionic2\ezpart-mobile-svn\node_modules\typescript\lib\t
ypescript.js:44563:16)
@ ./node_modules/rxjs/observable/bindNodeCallback.js 2:36-76
@ ./node_modules/rxjs/add/observable/bindNodeCallback.js
@ ./node_modules/rxjs/Rx.js
@ ./src/providers/loginProvider.ts
@ ./src/app/app.module.ngfactory.js
@ ./src/app/main.ts,./node_modules/rxjs/observable/BoundCallbackObservable.js
Module build failed: TypeError: Cannot read property 'type' of undefined
at Object.getEffectiveTypeAnnotationNode (D:\tmp\ionic2\ezpart-mobile-svn\no
de_modules\typescript\lib\typescript.js:9341:17)
at assignContextualParameterTypes (D:\tmp\ionic2\ezpart-mobile-svn\node_modu
les\typescript\lib\typescript.js:41652:25)
at checkFunctionExpressionOrObjectLiteralMethod (D:\tmp\ionic2\ezpart-mobile
-svn\node_modules\typescript\lib\typescript.js:41948:29)
at checkExpressionWorker (D:\tmp\ionic2\ezpart-mobile-svn\node_modules\types
cript\lib\typescript.js:42959:28)
at checkExpression (D:\tmp\ionic2\ezpart-mobile-svn\node_modules\typescript\
lib\typescript.js:42898:42)
at checkExpressionCached (D:\tmp\ionic2\ezpart-mobile-svn\node_modules\types
cript\lib\typescript.js:42779:38)
at checkReturnStatement (D:\tmp\ionic2\ezpart-mobile-svn\node_modules\typesc
ript\lib\typescript.js:45418:54)
at checkSourceElement (D:\tmp\ionic2\ezpart-mobile-svn\node_modules\typescri
pt\lib\typescript.js:46763:28)
at Object.forEach (D:\tmp\ionic2\ezpart-mobile-svn\node_modules\typescript\l
ib\typescript.js:1506:30)
at checkBlock (D:\tmp\ionic2\ezpart-mobile-svn\node_modules\typescript\lib\t
ypescript.js:44563:16)
@ ./node_modules/rxjs/observable/bindCallback.js 2:32-68
@ ./node_modules/rxjs/add/observable/bindCallback.js
@ ./node_modules/rxjs/Rx.js
@ ./src/providers/loginProvider.ts
@ ./src/app/app.module.ngfactory.js
@ ./src/app/main.ts
at BuildError.Error (native)
at new BuildError (D:\tmp\ionic2\ezpart-mobile-svn\node_modules\@ionic\app-s
cripts\dist\util\errors.js:16:28)
at callback (D:\tmp\ionic2\ezpart-mobile-svn\node_modules\@ionic\app-scripts
\dist\webpack.js:121:28)
at emitRecords.err (D:\tmp\ionic2\ezpart-mobile-svn\node_modules\webpack\lib
\Compiler.js:269:13)
at Compiler.emitRecords (D:\tmp\ionic2\ezpart-mobile-svn\node_modules\webpac
k\lib\Compiler.js:375:38)
at emitAssets.err (D:\tmp\ionic2\ezpart-mobile-svn\node_modules\webpack\lib\
Compiler.js:262:10)
at applyPluginsAsyncSeries1.err (D:\tmp\ionic2\ezpart-mobile-svn\node_module
s\webpack\lib\Compiler.js:368:12)
at next (D:\tmp\ionic2\ezpart-mobile-svn\node_modules\tapable\lib\Tapable.js
:218:11)
at Compiler.compiler.plugin (D:\tmp\ionic2\ezpart-mobile-svn\node_modules\we
bpack\lib\performance\SizeLimitsPlugin.js:99:4)
at Compiler.applyPluginsAsyncSeries1 (D:\tmp\ionic2\ezpart-mobile-svn\node_m
odules\tapable\lib\Tapable.js:222:13)
When using typescript 2.6.1 with ng serve --aot, I get this error when incrementally saving a .html or .ts file
(Which the fix here says to downgrade to typescript 2.4.2...)
ERROR in Error: Debug Failure. False expression: Host should not return a redirect source file from `getSourceFile`
at tryReuseStructureFromOldProgram (.../node_modules/typescript/lib/typescript.js:72100:26)
at Object.createProgram (.../node_modules/typescript/lib/typescript.js:71808:34)
at AngularCompilerProgram._updateProgramWithTypeCheckStubs (.../node_modules/@angular/compiler-cli/src/transformers/program.js:461:30)
at .../node_modules/@angular/compiler-cli/src/transformers/program.js:149:23
at process._tickCallback (internal/process/next_tick.js:103:7)
When using typescript 2.4.2 with ng build -prod, I get the error described above.
(Which the fix here says to upgrade typescript to 2.6.1.)
ERROR in ./node_modules/rxjs/_esm5/observable/BoundNodeCallbackObservable.js
Module build failed: TypeError: Cannot read property 'type' of undefined at Object.getEffectiveTypeAnnotationNode (node_modules/typescript/lib/typescript.js:9341:17).
So I am in a catch 22, where I need typescript 2.4.2 for ng serve --aot and typescript 2.6.1 for ng build --prod.
Reacted by Dave
Reacted by Mark Caulfield, Szymon, MikePaer, Bart, Nicolas Leblanc, Yaroslav Admin, Cabuxa.Mapache, MadMango and andreslopapa
With typescript 2.6.2, I still get the error when using ng serve --aot. It compiles perfectly the first time. Then when I save a .ts or .html file, I get this error:
ERROR in Error: Debug Failure. False expression: Host should not return a redirect source file from `getSourceFile`
at tryReuseStructureFromOldProgram (.../node_modules/typescript/lib/typescript.js:72296:26)
at Object.createProgram (.../node_modules/typescript/lib/typescript.js:72004:34)
at AngularCompilerProgram._updateProgramWithTypeCheckStubs (.../node_modules/@angular/compiler-cli/src/transformers/program.js:461:30)
at .../node_modules/@angular/compiler-cli/src/transformers/program.js:149:23
at process._tickCallback (internal/process/next_tick.js:103:7)
I just removed or replaced every unnecesary or unnused 'rxjs' import in my project but the error persist:
Module build failed: TypeError: Cannot read property 'type' of undefined
at Object.getEffectiveTypeAnnotationNode (/Users/german/github/angular-cms/node_modules/typescript/lib/typescript.js:9341:17)
at assignContextualParameterTypes (/Users/german/github/angular-cms/node_modules/typescript/lib/typescript.js:41652:25)
at checkFunctionExpressionOrObjectLiteralMethod (/Users/german/github/angular-cms/node_modules/typescript/lib/typescript.js:41948:29)
at checkExpressionWorker (/Users/german/github/angular-cms/node_modules/typescript/lib/typescript.js:42959:28)
at checkExpression (/Users/german/github/angular-cms/node_modules/typescript/lib/typescript.js:42898:42)
at checkExpressionCached (/Users/german/github/angular-cms/node_modules/typescript/lib/typescript.js:42779:38)
at checkReturnStatement (/Users/german/github/angular-cms/node_modules/typescript/lib/typescript.js:45418:54)
at checkSourceElement (/Users/german/github/angular-cms/node_modules/typescript/lib/typescript.js:46763:28)
at Object.forEach (/Users/german/github/angular-cms/node_modules/typescript/lib/typescript.js:1506:30)
at checkBlock (/Users/german/github/angular-cms/node_modules/typescript/lib/typescript.js:44563:16)
at checkSourceElement (/Users/german/github/angular-cms/node_modules/typescript/lib/typescript.js:46742:28)
at checkFunctionExpressionOrObjectLiteralMethodDeferred (/Users/german/github/angular-cms/node_modules/typescript/lib/typescript.js:41990:21)
at checkDeferredNodes (/Users/german/github/angular-cms/node_modules/typescript/lib/typescript.js:46828:25)
at checkSourceFileWorker (/Users/german/github/angular-cms/node_modules/typescript/lib/typescript.js:46863:17)
at checkSourceFile (/Users/german/github/angular-cms/node_modules/typescript/lib/typescript.js:46842:13)
at Object.forEach (/Users/german/github/angular-cms/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
@ ./src/app/shared/tables/staff-table/staff-table.component.ngfactory.js
@ ./src/app/components/staff/staff-list.component.ngfactory.js
@ ./src/app/app.module.ngfactory.js
@ ./src/main.ts
@ multi ./src/main.ts
ERROR in ./node_modules/rxjs/_esm5/observable/BoundCallbackObservable.js
Module build failed: TypeError: Cannot read property 'type' of undefined
at Object.getEffectiveTypeAnnotationNode (/Users/german/github/angular-cms/node_modules/typescript/lib/typescript.js:9341:17)
at assignContextualParameterTypes (/Users/german/github/angular-cms/node_modules/typescript/lib/typescript.js:41652:25)
at checkFunctionExpressionOrObjectLiteralMethod (/Users/german/github/angular-cms/node_modules/typescript/lib/typescript.js:41948:29)
at checkExpressionWorker (/Users/german/github/angular-cms/node_modules/typescript/lib/typescript.js:42959:28)
at checkExpression (/Users/german/github/angular-cms/node_modules/typescript/lib/typescript.js:42898:42)
at checkExpressionCached (/Users/german/github/angular-cms/node_modules/typescript/lib/typescript.js:42779:38)
at checkReturnStatement (/Users/german/github/angular-cms/node_modules/typescript/lib/typescript.js:45418:54)
at checkSourceElement (/Users/german/github/angular-cms/node_modules/typescript/lib/typescript.js:46763:28)
at Object.forEach (/Users/german/github/angular-cms/node_modules/typescript/lib/typescript.js:1506:30)
at checkBlock (/Users/german/github/angular-cms/node_modules/typescript/lib/typescript.js:44563:16)
at checkSourceElement (/Users/german/github/angular-cms/node_modules/typescript/lib/typescript.js:46742:28)
at checkFunctionExpressionOrObjectLiteralMethodDeferred (/Users/german/github/angular-cms/node_modules/typescript/lib/typescript.js:41990:21)
at checkDeferredNodes (/Users/german/github/angular-cms/node_modules/typescript/lib/typescript.js:46828:25)
at checkSourceFileWorker (/Users/german/github/angular-cms/node_modules/typescript/lib/typescript.js:46863:17)
at checkSourceFile (/Users/german/github/angular-cms/node_modules/typescript/lib/typescript.js:46842:13)
at Object.forEach (/Users/german/github/angular-cms/node_modules/typescript/lib/typescript.js:1506:30)
@ ./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
@ ./src/app/shared/tables/staff-table/staff-table.component.ngfactory.js
@ ./src/app/components/staff/staff-list.component.ngfactory.js
@ ./src/app/app.module.ngfactory.js
@ ./src/main.ts
@ multi ./src/main.ts```
Activity
aishanu commentedon Nov 2, 2017
I am getting prodction build issue after upgrading to Angular v5
HeroBart commentedon Nov 2, 2017
Look for
import { Observable } from 'rxjs/Rx'in your project and replace it withimport { Observable } from 'rxjs/Observable'Toxicable commentedon Nov 2, 2017
Hello, we reviewed this issue and determined that it doesn't fall into the bug report or feature request category. This issue tracker is not suitable for support requests, please repost your issue on StackOverflow using tag
angular.If you are wondering why we don't resolve support issues via the issue tracker, please check out this explanation.
rsaenen commentedon Nov 8, 2017
I had the same issue and I looked for all import from rxjs.
Ctrl+F for
import { x } from 'rxjs/'orimport { x } from 'rxjs/Rx'Anoop-Goudar commentedon Nov 9, 2017
Updating typescript to 2.6.1 will fix this issue, but we will have warning message as below
lukestayreal commentedon Nov 9, 2017
this solve my issue~~!!
sondreb commentedon Nov 10, 2017
I can also confirm that using the bindCallback operator on Observable will cause production build errors, unless TypeScript is upgraded above the "supported" version. It is not enough to simply upgrade global TypeScript to 2.6.1, also make sure you upgrade package.json or it won't work.
klochko7 commentedon Nov 13, 2017
I have the same error .. I am using .. Should I import import "rxjs" ?
lincolnthree commentedon Nov 13, 2017
@Anoop-Goudar Upgrading to TypeScript 2.6.1 also solved my issue. Thank you.
subatomicglue commentedon Nov 13, 2017
When using
typescript 2.6.1withng serve --aot, I get this error when incrementally saving a.htmlor.tsfile(Which the fix here says to downgrade to
typescript 2.4.2...)When using
typescript 2.4.2withng build -prod, I get the error described above.(Which the fix here says to upgrade
typescriptto2.6.1.)So I am in a catch 22, where I need
typescript 2.4.2forng serve --aotandtypescript 2.6.1forng build --prod.finalxcode commentedon Nov 17, 2017
my problem is ngx-datatable, after upgrade ngx-datatable to 11.0.4, i works swimlane/ngx-datatable#1104 (comment)
bastienlemaitre commentedon Nov 23, 2017
Works with Typescript 2.4.2, i have replaced
by
maiziheimei commentedon Nov 23, 2017
Yes, it solved by updating typescript's version
**For Exact version
npm install [email protected] --save
**For latest release
npm install typescript@latest --save
sburnicki commentedon Nov 23, 2017
I had this error when using
and needed to change it to
1 remaining item
rxjs ^5.5.0 & typescript 2.6.1 because of angular/angular#20095
bastienlemaitre commentedon Nov 24, 2017
You need to import operators.
iursevla commentedon Nov 25, 2017
@bastienlemaitre
how so? (Sorry if it's a noob question)
import { Operator } from 'rxjs/Operator';?? and then?iursevla commentedon Nov 28, 2017
I solved it by importing the operator as @bastienlemaitre said.
Like so:
giscafer commentedon Nov 30, 2017
I solved it by updating latest vesion
and
import { x } from 'rxjs' replace width import { x } from 'rxjs/Rx'subatomicglue commentedon Nov 30, 2017
With
typescript 2.6.2, I still get the error when usingng serve --aot. It compiles perfectly the first time. Then when I save a.tsor.htmlfile, I get this error:On Angular 5 build importing from rxjs without providing the required…
PixeliGer commentedon Dec 12, 2017
This is my project config:
I just removed or replaced every unnecesary or unnused
'rxjs'import in my project but the error persist:Bulan commentedon Dec 14, 2017
Thx, suggestion by BartBurger (3rd post) worked like a charm.
This should really make it into the upgrade guide, or an FAQ for upgrading
sanjaynegi commentedon Dec 15, 2017
Upgrading typescript to latest solved the issue
xiaosan666 commentedon Apr 14, 2018
npm i [email protected] --save-dev
angular-automatic-lock-bot commentedon Sep 14, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.