You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unexpected value 'NgReduxModule' imported by the module 'AppEngine' #228
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.
Reacted by Lars Rye Jeppesen, Duy Dao and Jason Yang/楊朝傑
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.
@h2qutcngc 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.
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).
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.
Reacted by hqho, Jason Yang/楊朝傑 and Lars Rye Jeppesen
Activity
dagstuan commentedon Sep 30, 2016
Its due to missing metadata.json-files, see #223.
e-schultz commentedon Oct 3, 2016
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.
e-schultz commentedon Oct 6, 2016
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.
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.
e-schultz commentedon Oct 6, 2016
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
@selectdecorator just fails to work, will investigate further.NeoLSN commentedon Oct 7, 2016
@e-schultz still the same problem.
h2qutc commentedon Oct 7, 2016
Hi,
Is there a tuto or a book that explain how to create a file metadata.json for a file *.d.ts ?
Thanks
dagstuan commentedon Oct 7, 2016
@h2qutc
ngcautomatically generates them when it builds a project, there is nothing else to it :) If the project is built withngcit will have*.metadata.jsonfiles along with.jsfiles.smkamranqadri commentedon Oct 10, 2016
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'
duydao commentedon Oct 10, 2016
Could this issue be related to the fact that NgRedux is using generic types?
angular/angular#11057
h2qutc commentedon Oct 11, 2016
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?
SethDavenport commentedon Oct 12, 2016
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.
smkamranqadri commentedon Oct 12, 2016
i wan thinking to switch to ngrx/store instead as i can't wait for the issue to be resolve.
smkamranqadri commentedon Oct 12, 2016
i got solution to complete the app with ngc and no need to switch. well looking forward for the resolution as soon as possible.
NeoLSN commentedon Oct 12, 2016
@e-schultz @SethDavenport Just hope this issue can be resolved as soon as you can.
h2qutc commentedon Oct 12, 2016
@smkamranqadri Can you share the solution that you got please?
30 remaining items
MichalZak commentedon Nov 7, 2016
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
NeoLSN commentedon Nov 7, 2016
@SethDavenport Yes, I still get
Generic type 'NgRedux' requires 1 type argument(s).issue.Sorry for the late response.
SethDavenport commentedon Nov 7, 2016
can you try an
rm -rf node_modules; npm cache clean; npm install?NeoLSN commentedon Nov 8, 2016
@SethDavenport
SethDavenport commentedon Nov 8, 2016
I believe I have identified the cause. Working on a fix now.
SethDavenport commentedon Nov 8, 2016
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
Make NgReduxModule.forRoot() expose providers correctly for AoT.
Make NgReduxModule.forRoot() expose providers correctly for AoT. (#252)
SethDavenport commentedon Nov 8, 2016
Can you try [email protected]? Should be fixed now. Sorry about that.
NeoLSN commentedon Nov 8, 2016
Yes, it works on
[email protected]. Thanks!!!!SethDavenport commentedon Nov 8, 2016
Phew! Sorry that took so long.
stevencohn commentedon Mar 28, 2017
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.
SethDavenport commentedon Mar 28, 2017
actually property path selectors are already supported with the following syntax:
@select(['foo', 'bar']) something