tflori / angular-translator

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

Build issue with angular 4.2.3 #46

Closed BorntraegerMarc closed 7 years ago

BorntraegerMarc commented 7 years ago

When I run ng build with angular 4.2.3 then I get the following error:

Hash: 657aa3bb4f96faf4a576
Time: 24526ms
chunk    {0} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 160 kB {4} [initial] [rendered]
chunk    {1} main.bundle.js, main.bundle.js.map (main) 244 kB {3} [initial] [rendered]
chunk    {2} styles.bundle.js, styles.bundle.js.map (styles) 10.5 kB {4} [initial] [rendered]
chunk    {3} vendor.bundle.js, vendor.bundle.js.map (vendor) 3.5 MB [initial] [rendered]
chunk    {4} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]

ERROR in D:/projects/komed-health-web/node_modules/angular-translator/src/TranslatorConfig.ts (64,34): Supplied parameters do not match any signature of call target.

ERROR in D:/projects/komed-health-web/node_modules/angular-translator/src/TranslatorConfig.ts (134,34): Supplied parameters do not match any signature of call target.

Here is my full package.json dependencies:

  "dependencies": {
    "@angular/animations": "4.2.3",
    "@angular/common": "4.2.3",
    "@angular/compiler": "4.2.3",
    "@angular/core": "4.2.3",
    "@angular/forms": "4.2.3",
    "@angular/http": "4.2.3",
    "@angular/platform-browser": "4.2.3",
    "@angular/platform-browser-dynamic": "4.2.3",
    "@angular/platform-server": "4.2.3",
    "@angular/router": "4.2.3",
    "@angular/service-worker": "1.0.0-beta.16",
    "@codebakery/origami": "1.2.2",
    "@types/socket.io-client": "1.4.29",
    "angular-translator": "2.1.0",
    "core-js": "2.4.1",
    "rollup": "0.43.0",
    "rollup-plugin-commonjs": "8.0.2",
    "rollup-plugin-node-resolve": "3.0.0",
    "rxjs": "5.4.1",
    "tributejs": "2.3.7",
    "zone.js": "0.8.12"
  },
  "devDependencies": {
    "@angular/cli": "1.1.2",
    "@angular/compiler-cli": "4.2.3",
    "@types/jasmine": "2.5.52",
    "@types/node": "8.0.0",
    "codelyzer": "3.0.1",
    "cpr": "2.1.0",
    "jasmine-core": "2.6.4",
    "jasmine-spec-reporter": "4.1.0",
    "karma": "1.7.0",
    "karma-chrome-launcher": "2.1.1",
    "karma-cli": "1.0.1",
    "karma-coverage-istanbul-reporter": "1.3.0",
    "karma-jasmine": "1.1.0",
    "karma-jasmine-html-reporter": "0.2.2",
    "polymer-cli": "1.2.0",
    "protractor": "5.1.2",
    "rimraf": "2.6.1",
    "ts-node": "3.0.6",
    "tslint": "5.4.3",
    "typescript": "2.3.4"
  }
BorntraegerMarc commented 7 years ago

@tflori is it maybe because of an updated typescript version?

BorntraegerMarc commented 7 years ago

It was really because of angular. After downgrading to 4.1.3 everything worked

@tflori could you add support for angular 4.2+ ?

tflori commented 7 years ago

@BorntraegerMarc thanks, for the info. I will fix it (maybe tomorrow morning, maybe today in the evening)..

BorntraegerMarc commented 7 years ago

@tflori Is there something I can do to help you accelerate the process? We desperately need this...

tflori commented 7 years ago

Of course! If you have a solution you can create a Pull Request

Marc Bornträger notifications@github.com schrieb am Di., 20. Juni 2017, 18:35:

@tflori https://github.com/tflori Is there something I can do to help you accelerate the process? We desperately need this...

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/tflori/angular-translator/issues/46#issuecomment-309815867, or mute the thread https://github.com/notifications/unsubscribe-auth/AEoXO9KPpFlJPtp687LmGwKg8acpT653ks5sF_TOgaJpZM4N_JQL .

tflori commented 7 years ago

https://fossies.org/diffs/angular/4.1.3_vs_4.2.0/packages/compiler/test/pipe_resolver_spec.ts-diff.html

i just have two problems:

  1. I don't know if I can do this on angular 4.1.3 and before
  2. I get a timeout from browsers after an npm update when running the tests
BorntraegerMarc commented 7 years ago

@tflori good catch. Maybe you could release a breaking change version 3.0 for this library? Basically the only difference would be a peer dependency of at least angular 4.2.0

My guess is that most of the developers won't have problems to upgrade the code from 4.1.3 to 4.2.0...

BorntraegerMarc commented 7 years ago

Sorry, can't find the time at the moment to help you out with a PR...

firstor commented 7 years ago

@tflori Regarding the issue, it occurs basically on the TranslatorConfig.ts [64] in my case. Did you check this commit: https://github.com/angular/angular/commit/50abca4583eb54bcab030a708f65ad11058082d9? There are main changes between compiler v4.1.3 and v4.2. As I had a brief look at it, JitReflector may be the best candidate to pass to the PipeResolver.constructor.

I tried to pass new JitReflector() to the PipeResolver.constructor and so could pass through compilation, however, I got the following error on my browser. Error: Template parse errors:

The pipe 'translate' could not be found ("end-background">
        <app-toolbar>
            <div ... id="title">{{[ERROR ->]'welcome.title' | translate}}</div>
        </app-toolbar>
    </app-header>
"):

Just hope you get any hint from my attempt and resolve this issue asap.

Thanks.

tflori commented 7 years ago

@first87 this must be another error. everything working fine on my angular-translator-demo with this change.

can both please try angular-translator@2.1.1-alpha.2.

I hope I can get a fix for this breaking change in angular (I will open a PR soon).

BorntraegerMarc commented 7 years ago

@tflori This fixed the issue! Thanks a lot!

tflori commented 7 years ago

https://github.com/angular/angular/issues/17653

tflori commented 7 years ago

I will wait for an answer if we have to create a new version because of this ***ing breaking change that is not even mentioned in the changelog. Really annoying for such a big project like angular.

firstor commented 7 years ago

@tflori angular-translator@2.1.1-alpha.2 works good and it resolved the issue.

tflori commented 7 years ago

@BorntraegerMarc @first87 As my ticket got closed I had to find another solution. And I found one not to make it incompatible with previous version of angular. It is already published under 2.1.1-alpha.4 and I will release after the merge version 2.1.1.

BorntraegerMarc commented 7 years ago

Cool, thx!