ngx-translate / core

The internationalization (i18n) library for Angular
MIT License
4.51k stars 574 forks source link

rxjs.of is not a function #891

Open faizalluthfi opened 6 years ago

faizalluthfi commented 6 years ago

rxjs.of is not a function in file ngx-translate-core.umd.js. But the module works if I replace all occurrences of "rxjs.of" to "rxjs.Observable.of" it that file.

mbakker96 commented 6 years ago

Do you use version ngx-translate 10 with angular 6?

faizalluthfi commented 6 years ago

Yes, right

dolyGD commented 6 years ago

Same Issue 'rxjs_Observable__WEBPACK_IMPORTED_MODULE_1__.Observable.of is not a function'..? with angular 6.

davidquintard commented 6 years ago

Same issue:

TypeError: __WEBPACK_IMPORTED_MODULE_3_rxjs_Observable__.Observable.fromPromise is not a function
Trace de la pile :
JwtInterceptor.prototype.intercept@http://localhost:8100/build/vendor.js:93181:20
HttpInterceptorHandler.prototype.handle@http://localhost:8100/build/vendor.js:32056:16
PendingInterceptorService.prototype.intercept@http://localhost:8100/build/vendor.js:72495:16
HttpInterceptorHandler.prototype.handle@http://localhost:8100/build/vendor.js:32056:16
HttpXsrfInterceptor.prototype.intercept@http://localhost:8100/build/vendor.js:32660:20
HttpInterceptorHandler.prototype.handle@http://localhost:8100/build/vendor.js:32056:16
HttpInterceptingHandler.prototype.handle@http://localhost:8100/build/vendor.js:32707:16
HttpClient.prototype.request/events$<@http://localhost:8100/build/vendor.js:31893:172
MergeMapSubscriber.prototype._tryNext@http://localhost:8100/build/vendor.js:51643:22
MergeMapSubscriber.prototype._next@http://localhost:8100/build/vendor.js:51633:13
Subscriber.prototype.next@http://localhost:8100/build/vendor.js:25086:13
scalar/result<@http://localhost:8100/build/vendor.js:61481:9
Observable.prototype._trySubscribe@http://localhost:8100/build/vendor.js:25408:20
Observable.prototype.subscribe@http://localhost:8100/build/vendor.js:25394:17
MergeMapOperator.prototype.call@http://localhost:8100/build/vendor.js:51611:16
Observable.prototype.subscribe@http://localhost:8100/build/vendor.js:25389:13
FilterOperator.prototype.call@http://localhost:8100/build/vendor.js:51769:16
Observable.prototype.subscribe@http://localhost:8100/build/vendor.js:25389:13
MapOperator.prototype.call@http://localhost:8100/build/vendor.js:30156:16
Observable.prototype.subscribe@http://localhost:8100/build/vendor.js:25389:13
[1003]/CustomTranslateLoader.prototype.getTranslation/<@http://localhost:8100/build/main.js:126:20
zentoaku commented 6 years ago

Same here. Angular: 6.1.4 ngx-translate: 10.0.2

ERROR TypeError: rxjs_Observable__WEBPACK_IMPORTED_MODULE_6__.Observable.of is not a function

Usually this error appears if you use rxjs4/5-compat syntax or operators with rxjs 6 that is required by Angular 6+. You will need to change all occurrences of Observable.of to just "of" and use the proper import :)

zentoaku commented 6 years ago

I've just went very carefully through all my code, fixed all code to use proper rxjs6 syntax without compatibility fallbacks and the error is gone.

davidquintard commented 6 years ago

I've installed rxjs-compat. It seems error is gone.

ronaiza-cardoso commented 6 years ago

@pairmix this solve my issue

shahidneermunda commented 6 years ago

npm install rxjs-compat@6.0.0-tactical-rc.1

help to solve my problem

mbakker96 commented 6 years ago

I think that the problem is that you use the old standard for rxjs. rxjs updated to version 6 few months ago and did bring a lot of breaking changes with it. It did cost me a few days to rewrite a lot of code.

ngx-translate use since version x rxjs 6 (have to look it up in the changelog). This means that there will be errors when you compile your code due to the fact that rxjs does not support v5 code.

If you don't have a few days or not anough coffee, then you can use rxjs-compat to support V5 features with V6.

For more information: rxjs migration what changed?

Minipada commented 6 years ago

angular 6.0.9 ngx-translate: 8.0.0

I also downgraded to 6.0.0 to make it work. Probably the software with which I work has not been migrated...

thanhphuocdang commented 6 years ago

Update @ngx-translate/core@10.0.2 to resolve that, For me.

Nonudeveloper commented 5 years ago

npm install rxjs-compat@6.0.0-tactical-rc.1 worked for me