core icon indicating copy to clipboard operation
core copied to clipboard

TypeError: Cannot read property 'subscribe' of undefined

Open JairoRC opened this issue 4 years ago • 3 comments

Hello friends! The first thing to thank for your work which has helped me a lot to create multilanguage applications, currently I am passing the tests with Karma in Angular9 obtaining the following error:

TypeError: Cannot read property 'subscribe' of undefined at <Jasmine> at TranslatePipe.updateValue (http://localhost:9876/karma_webpack/node_modules/@ngx-translate/core/ivy_ngcc/fesm2015/ngx-translate-core.js:1508:1) at TranslatePipe.transform (http://localhost:9876/karma_webpack/node_modules/@ngx-translate/core/ivy_ngcc/fesm2015/ngx-translate-core.js:1549:1) at ɵɵpipeBind1 (http://localhost:9876/karma_webpack/node_modules/@angular/core/ivy_ngcc/fesm2015/core.js:36748:1) at LoginScreenComponent_Template (ng:///LoginScreenComponent.js:59:33) at executeTemplate (http://localhost:9876/karma_webpack/node_modules/@angular/core/ivy_ngcc/fesm2015/core.js:12010:1) at refreshView (http://localhost:9876/karma_webpack/node_modules/@angular/core/ivy_ngcc/fesm2015/core.js:11857:1) at refreshComponent (http://localhost:9876/karma_webpack/node_modules/@angular/core/ivy_ngcc/fesm2015/core.js:13295:1) at refreshChildComponents (http://localhost:9876/karma_webpack/node_modules/@angular/core/ivy_ngcc/fesm2015/core.js:11586:1) at refreshView (http://localhost:9876/karma_webpack/node_modules/@angular/core/ivy_ngcc/fesm2015/core.js:11909:1) at renderComponentOrTemplate (http://localhost:9876/karma_webpack/node_modules/@angular/core/ivy_ngcc/fesm2015/core.js:11983:1)

I have tried different solutions, some of which obtained from various colleagues in forums without satisfactory result, The component has an empty controller, it is simply an html template that uses the translations pipeline.

JairoRC avatar Jun 09 '20 09:06 JairoRC

Might you provide a minimum reproduction example?

raspyweather avatar Jun 16 '20 09:06 raspyweather

Were

Hello friends! The first thing to thank for your work which has helped me a lot to create multilanguage applications, currently I am passing the tests with Karma in Angular9 obtaining the following error:

TypeError: Cannot read property 'subscribe' of undefined at at TranslatePipe.updateValue (http://localhost:9876/karma_webpack/node_modules/@ngx-translate/core/ivy_ngcc/fesm2015/ngx-translate-core.js:1508:1) at TranslatePipe.transform (http://localhost:9876/karma_webpack/node_modules/@ngx-translate/core/ivy_ngcc/fesm2015/ngx-translate-core.js:1549:1) at ɵɵpipeBind1 (http://localhost:9876/karma_webpack/node_modules/@angular/core/ivy_ngcc/fesm2015/core.js:36748:1) at LoginScreenComponent_Template (ng:///LoginScreenComponent.js:59:33) at executeTemplate (http://localhost:9876/karma_webpack/node_modules/@angular/core/ivy_ngcc/fesm2015/core.js:12010:1) at refreshView (http://localhost:9876/karma_webpack/node_modules/@angular/core/ivy_ngcc/fesm2015/core.js:11857:1) at refreshComponent (http://localhost:9876/karma_webpack/node_modules/@angular/core/ivy_ngcc/fesm2015/core.js:13295:1) at refreshChildComponents (http://localhost:9876/karma_webpack/node_modules/@angular/core/ivy_ngcc/fesm2015/core.js:11586:1) at refreshView (http://localhost:9876/karma_webpack/node_modules/@angular/core/ivy_ngcc/fesm2015/core.js:11909:1) at renderComponentOrTemplate (http://localhost:9876/karma_webpack/node_modules/@angular/core/ivy_ngcc/fesm2015/core.js:11983:1)

I have tried different solutions, some of which obtained from various colleagues in forums without satisfactory result, The component has an empty controller, it is simply an html template that uses the translations pipeline.

Were you able to solve this ?

muhammadzarif903 avatar Jan 24 '22 15:01 muhammadzarif903