-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected value 'NgReduxModule' imported by the module 'AppEngine' #228
Comments
Its due to missing metadata.json-files, see #223. |
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. |
Been busy traveling for work lately and haven't had as much time to work on this, but have a test module published at 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. |
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 |
@e-schultz still the same problem. |
Hi, |
@h2qutc |
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' |
Could this issue be related to the fact that NgRedux is using generic types? |
Hi,
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:
Any help please? |
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. |
i wan thinking to switch to ngrx/store instead as i can't wait for the issue to be resolve. |
i got solution to complete the app with ngc and no need to switch. well looking forward for the resolution as soon as possible. |
@e-schultz @SethDavenport Just hope this issue can be resolved as soon as you can. |
@smkamranqadri Can you share the solution that you got please? |
find can find here... |
My update on this: I have a version working
However, I was hoping to have both issues resolved in one release, as well - I'm big fan of Another workaround is to do a prod build, but with AoT turned off
If people are ok with class MyClass {
@select() stuff$;
}
// to
class MyClass {
stuff$;
ngOnInt() {
this.stuff=this.ngRedux.select('stuff');
}
} I can push out a non beta release of this soon. I have an idea later tonight I want to try out to get |
note: when I say |
@e-schultz If there is a But it is still got error |
+1 |
I tried that using "--dev" to build app. And, yes, the app can be built, but when app open it always shows Could someone give me any suggestion? |
@NeoLSN I run into the same error message, but it was caused by a dependency of redux itself (symbol-observable@1.0.3). There seems to be a difference of the index.js file on git (https://github.com/blesh/symbol-observable/blob/master/es/index.js) and the npm package. I've already created an issue for it: benlesh/symbol-observable#26 for now, you could replace the content of the index.js file in your node_modules with the one on git: (https://github.com/blesh/symbol-observable/blob/master/es/index.js) |
@e-schultz Could you share your current progress on this issue? Maybee we are able to help figuring out why the select doesn't work |
For someone who want to build with JIT compiler |
@e-schultz |
@NeoLSN can you try ng-redux@aot-beta? I'm not getting that issue in the toy app that I'm playing around with. The issue seems to be that AoT just doesn't like decorators that mutate the class. Even creating a simple decorator that adds a getter to return the string 'this works' - works without AoT, stops working with AoT - no error/bug/warning, just silently stops working. The 'list of things that AoT doesn't support / throws errors on / silently has failing behavior with no error or warning' has me questioning the readiness of AoT for production use (even outside of use with ng2-redux). Later tonight I'll push up my work in progress / example app. Ideally I wanted to get a release out that would have both the module issue + decorators working in the same release, but what I may need to do is a release w/o decorators working with migration docs (pretty easy, but annoying - and really want to avoid pushing that onto the users), and then try and see if I can figure out a solution for the decorators. |
@e-schultz |
Thank you for all the great work, guys.. |
There seems to be challenges with the ngc compiler working with generics as injectables and there is an issue on the angular repo for it, But when that issue gets closed with "its by design", and "I'm making a list of patterns that are supported and not by AoT - but it's taking too long because the only way to see the error is to run it" is what makes me go 😱 and question AoT's readiness for production. I've been playing around with the angular cli, and also compiler cli - is if you don't tell ngc to ignore WIth the cli-generated project I've been playing with, if I try and use ngc directly - 1st run - no errors (not sure if the app actually works or not) - 2nd run - it tries to run ngc on the generated .ngfactory artifacts - and throws an error - remove the factory files - 3rd run - runs w/o error againIf you tweak your config to tell it to put the angular compiler generated files elsewhere ... {
"compilerOptions": {
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": ["es6", "dom"],
"mapRoot": "./",
"module": "es6",
"moduleResolution": "node",
"outDir": "../dist/out-tsc",
"sourceMap": true,
"target": "es5",
"typeRoots": [
"../node_modules/@types"
]
},
"angularCompilerOptions": {
"genDir": "../ngfactory"
}
} so that ngc won't try to recompile it's own output - the error from compiling stops happening. I haven't tried to actually bootstrap/run the output yet - so unsure if it works as expected, but at least the compiler stops complaining. Not sure how much of a help this is, just sharing the findings from my exploration so far. |
Just published a new beta. Slight change with how you import the module, now should do |
Did I do something wrong? |
Just provide another workaround.
This method will be better than using wrapper class. It is still a workaround. Don't do this if you have another choice. |
@NeoLSN Thanks for posting this man! Will give it a go! |
@danielcrk-cn @NeoLSN 4.0.0-beta.7 is now out, should fix that issue now - I had broken the generation of the metadata file which should be resolved now. |
I've tried the new beta now, and still get the same error, In app.module.ts, i've added |
@NeoLSN your latest workaround seems to be working great! thanks again! |
@danielcrk-cn I have been able to get ng2-redux@4.0.0-beta.7 working with Angular CLI and AoT here: https://github.com/SethDavenport/ng2-redux--with-aot To run it, clone the repo and do:
Can you share your repo where you're having the issue? |
@NeoLSN, @danielcrk-cn: it's unfortunate that we have to resort to such a workaround. I myself am having trouble reproducing the 'generic' error, but some of my colleagues have encountered it; my working theory is that it happens when you use Further, I suspect that we may be able to resolve it by dropping the I've published a tag to test this out; can you try |
Fixed in 4.0.0. |
I just upgraded to 4.0.0, but im still getting the error. Besides using NgReduxModule.forRoot(), what else do I need to make sure of. Mike |
@SethDavenport Yes, I still get Sorry for the late response. |
can you try an |
|
I believe I have identified the cause. Working on a fix now. |
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 |
Can you try ng2-redux@4.1.0? Should be fixed now. Sorry about that. |
Yes, it works on |
Phew! Sorry that took so long. |
actually property path selectors are already supported with the following syntax: |
Did someone know how to solve it?
The text was updated successfully, but these errors were encountered: