Skip to content

Unexpected value 'NgReduxModule' imported by the module 'AppEngine' #228

Closed

Description

@NeoLSN
ngc error: Error: Unexpected value 'NgReduxModule' imported by the module 'AppEngine'

Did someone know how to solve it?

Activity

  1. dagstuan commented on Sep 30, 2016

    @dagstuan

    Its due to missing metadata.json-files, see #223.

  2. e-schultz commented on Oct 3, 2016

    @e-schultz
    Member

    I hope to get this fixed this week, just been travelling and haven't had time to fully test things, but having ng2-redux work with AoT is high on my priority list.

  3. e-schultz commented on Oct 6, 2016

    @e-schultz
    Member

    Been busy traveling for work lately and haven't had as much time to work on this, but have a test module published at 4.0.0-aotbeta.3 - still not fully working.

    One error once I've gotten past the NgModule error, is how it behaves when you pass functions into selectors.

    export const stuffSelect = n=>n.tuff;
    export class Stuff {
      @select(n=>n.stuff) thisWillCauseAnError$
      @select(stuffSelect) thisWilNotCauseAnError$
    }
    

    If anyone has a demo repo with an AoT app working that they could point me at to help play around with as a test bed, that would be great.

  4. e-schultz commented on Oct 6, 2016

    @e-schultz
    Member

    Some update/progress:

    Working on a repo with master of angular-cli.

    e-schultz/ng2-redux-aot-example#1

    Have it so things don't throw errors, however the @select decorator just fails to work, will investigate further.

  5. NeoLSN commented on Oct 7, 2016

    @NeoLSN
    Author

    @e-schultz still the same problem.

  6. h2qutc commented on Oct 7, 2016

    @h2qutc

    Hi,
    Is there a tuto or a book that explain how to create a file metadata.json for a file *.d.ts ?
    Thanks

  7. dagstuan commented on Oct 7, 2016

    @dagstuan

    @h2qutc ngc automatically generates them when it builds a project, there is nothing else to it :) If the project is built with ngc it will have *.metadata.json files along with .js files.

  8. smkamranqadri commented on Oct 10, 2016

    @smkamranqadri

    any expected date when it will be resole, i stuck with ionic 2 rc0 app. which is using ngc and giving below error.

    ngc: Error: Unexpected value 'NgReduxModule' imported by the module 'StoreModule'

  9. duydao commented on Oct 10, 2016

    @duydao

    Could this issue be related to the fact that NgRedux is using generic types?

    angular/angular#11057

  10. h2qutc commented on Oct 11, 2016

    @h2qutc

    Hi,
    I managed to resolve this error. I create a new module to remplace NgReduxModule and add it into imports

    import { NgModule } from '@angular/core'; import { NgRedux, select } from 'ng2-redux';

    @NgModule({ imports: [ ], declarations: [ ], exports: [ ], entryComponents: [ ] }) export class AppNgReduxModule { static forRoot() { return { ngModule: AppNgReduxModule, providers: [NgRedux], }; } }

    Although I'm having another error and I not sure that this is a workaround for this issus. Anyway, I don't have this error anymore. But now, I got an another error:

    ngc: Error: Error at c:/MCNEXT/Vinci/Vinci-RSC%20Mobile/.tmp/app/app.module.ngfactory.ts:174:15: Generic type 'NgRedux<RootState>' requires 1 type argument(s).

    Any help please?

  11. SethDavenport commented on Oct 12, 2016

    @SethDavenport
    Member

    seems likely that it is due to the issue referenced by @duydao. NgRedux has a type parameter so you can strongly type your store; it would be a shame to sacrifice this. The increasing list of basic language constructs not supported by AoT is becoming tiresome.

    Nonetheless we'll see what we can do. @e-schultz let's chat more about this when you're back.

  12. smkamranqadri commented on Oct 12, 2016

    @smkamranqadri

    i wan thinking to switch to ngrx/store instead as i can't wait for the issue to be resolve.

  13. smkamranqadri commented on Oct 12, 2016

    @smkamranqadri

    i got solution to complete the app with ngc and no need to switch. well looking forward for the resolution as soon as possible.

  14. NeoLSN commented on Oct 12, 2016

    @NeoLSN
    Author

    @e-schultz @SethDavenport Just hope this issue can be resolved as soon as you can.

  15. h2qutc commented on Oct 12, 2016

    @h2qutc

    @smkamranqadri Can you share the solution that you got please?

  16. 30 remaining items

  17. MichalZak commented on Nov 7, 2016

    @MichalZak

    I just upgraded to 4.0.0, but im still getting the error.
    Generic type 'NgRedux' requires 1 type argument(s).

    Besides using NgReduxModule.forRoot(), what else do I need to make sure of.
    Im developing with Ionic2/Webpack

    Mike

  18. NeoLSN commented on Nov 7, 2016

    @NeoLSN
    Author

    @SethDavenport Yes, I still get Generic type 'NgRedux' requires 1 type argument(s). issue.

    Sorry for the late response.

  19. SethDavenport commented on Nov 7, 2016

    @SethDavenport
    Member

    can you try an rm -rf node_modules; npm cache clean; npm install ?

  20. NeoLSN commented on Nov 8, 2016

    @NeoLSN
    Author

    @SethDavenport

    [09:44:06]  Error: Error at <project_root>/.tmp/app/app.module.ngfactory.ts:129:15
    [09:44:06]  Generic type 'NgRedux<RootState>' requires 1 type argument(s).
    [09:44:06]  ngc failed
    [09:44:06]  ionic-app-script task: "build"
    [09:44:06]  Error: Error
    
  21. SethDavenport commented on Nov 8, 2016

    @SethDavenport
    Member

    I believe I have identified the cause. Working on a fix now.

  22. SethDavenport commented on Nov 8, 2016

    @SethDavenport
    Member

    FWIW, if you're struggling with AoT in any of your own code, my colleague @watrool has build a very handy test harness for AoT issues: https://github.com/rangle/angular-2-aot-sandbox

  23. SethDavenport commented on Nov 8, 2016

    @SethDavenport
    Member

    Can you try [email protected]? Should be fixed now. Sorry about that.

  24. NeoLSN commented on Nov 8, 2016

    @NeoLSN
    Author

    Yes, it works on [email protected]. Thanks!!!!

  25. SethDavenport commented on Nov 8, 2016

    @SethDavenport
    Member

    Phew! Sorry that took so long.

  26. stevencohn commented on Mar 28, 2017

    @stevencohn

    While this syntax doesn't seem to work when building @select(s => s.foo.bar) something;
    this does: @select('foo.bar') something;

    So replace the lambda parameter to @select with a string parameter.

  27. SethDavenport commented on Mar 28, 2017

    @SethDavenport
    Member

    actually property path selectors are already supported with the following syntax: @select(['foo', 'bar']) something

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions