tflori / angular-translator

translation module for angular
https://tflori.github.io/angular-translator/
MIT License
21 stars 6 forks source link

(intermediate value).share is not a function #72

Closed fudandori closed 5 years ago

fudandori commented 5 years ago

Hi, I was using Angular 4.2 and recently upgraded to 7.0 and looks like the translator broke. Whenever I try to load a page that makes use of the translate pipe it throws the error.

The stacks reads as follows:

ERROR Error: Uncaught (in promise): TypeError: (intermediate value).share is not a function TypeError: (intermediate value).share is not a function at new TranslatorContainer (angular-translator.js:899) at _createClass (core.js:17836) at _createProviderInstance (core.js:17804) at resolveNgModuleDep (core.js:17768) at _callFactory (core.js:17853) at createProviderInstance (core.js:17807) at resolveNgModuleDep (core.js:17768) at NgModuleRef.push../nodemodules/@angular/core/fesm5/core.js.NgModuleRef.get (core.js:18476) at resolveDep (core.js:18847) at createClass (core.js:18723) at new TranslatorContainer (angular-translator.js:899) at _createClass (core.js:17836) at _createProviderInstance (core.js:17804) at resolveNgModuleDep (core.js:17768) at _callFactory (core.js:17853) at createProviderInstance (core.js:17807) at resolveNgModuleDep (core.js:17768) at NgModuleRef.push../nodemodules/@angular/core/fesm5/core.js.NgModuleRef.get (core.js:18476) at resolveDep (core.js:18847) at createClass (core.js:18723) at resolvePromise (zone.js:814) at resolvePromise (zone.js:771) at zone.js:873 at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:421) at Object.onInvokeTask (core.js:14182) at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:420) at Zone.push../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:188) at drainMicroTaskQueue (zone.js:595)

tflori commented 5 years ago

I don't think this comes from angular translator. Most likely the type is not imported:

import "rxjs/add/operator/share";

But it is imported in TranslatorContainer

luisantonio071 commented 5 years ago

I have the same issue. Recently upgraded from 5.2 to 7 so when I try to load the main page the same error appears. ERROR TypeError: (intermediate value).share is not a function at new TranslatorContainer (angular-translator.js:899) at _createClass (core.js:17788) at createProviderInstance (core.js:17756) at resolveNgModuleDep (core.js:17720) at NgModuleRef.push../nodemodules/@angular/core/fesm5/core.js.NgModuleRef.get (core.js:18428) at resolveDep (core.js:18799) at createClass (core.js:18673) at createDirectiveInstance (core.js:18550) at createViewNodes (core.js:19776) at callViewAction (core.js:20092)

By the way, everything worked fine before the upgrade

tflori commented 5 years ago

https://update.angular.io/

When I have a look at what to do to upgrade from 6 to 7 I see the reason: a lot of incompatibilities in Http module and rxjs. The problem is that the required changes are incompatible with angular 6 and before - means we need a new version.

Now a I have a problem. On one hand I'm proud of this library is still being preferred by some users (at least ~100 downloads per week). Even when there is no release since 8 months (and no issues so far). On the other hand: I'm not using angular in any project and have a lot of other open source libraries to maintain.

Maybe someone can provide a pull request to fix the issues for a new version? I would appreciate another maintainer for this library.

tflori commented 5 years ago

have you installed rxjs-compat for compatibility?

fudandori commented 5 years ago

I don't think this comes from angular translator. Most likely the type is not imported:

import "rxjs/add/operator/share";

But it is imported in TranslatorContainer

Sorry for the delayed response.

That's the first thing I checked, that everything was imported, even tried to edit the way it imported the operators (just in case) and still nothing. Got both the new rxjs and rxjs-compat.

Can't figure out what the actual problem is, I'm not that skilled in programming.

tflori commented 5 years ago

I hope this will solve the problems: https://github.com/tflori/angular-translator/commit/b7cbcb33fc8a312e0044f5692b0e5ba29e2023a2

I will release a rc.1 when tests are green

tflori commented 5 years ago

I don't get it published. Typescript compiles but ngc throws because of a duplicate property :disappointed:

tflori commented 5 years ago

finally it works. please try 3.0.0-rc.2 for angular7

fudandori commented 5 years ago

finally it works. please try 3.0.0-rc.2 for angular7

Hello.

I did a small local test and the error disappeared. I'll continue testing more thoroughly the following days and keep you posted if I find anything amiss.

Thanks and good work.

tflori commented 5 years ago

version 3.0 is now released. feel free to reopen if the error is still not solved