Skip to content
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

Ahead-of-Time (AoT) compilation fails #13

Closed
ttmarek opened this issue Nov 10, 2016 · 4 comments
Closed

Ahead-of-Time (AoT) compilation fails #13

ttmarek opened this issue Nov 10, 2016 · 4 comments

Comments

@ttmarek
Copy link

ttmarek commented Nov 10, 2016

Hi @btroncone,

First, thanks for all your hard work on this lib, it's great. But, recently I've been running into some issues with getting the AoT compiler to successfully compile the ngrx-store-logger. Here's the error I'm getting:

Error encountered resolving symbol values statically. Function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol AppModule in /path/to/app.module.ts, resolving symbol AppModule in /path/to/app.module.ts

We've set up an example that you can easily run to reproduce the problem here: https://github.com/rangle/angular-2-aot-sandbox

Just follow these steps:

git clone [email protected]:rangle/angular-2-aot-sandbox.git

cd angular2-aot-sandbox

npm install

node sandbox-loader.js ngrx-store-logger

You can find the example source here: https://github.com/rangle/angular-2-aot-sandbox/tree/master/tests/ngrx-store-logger

Any idea why this might be happening?

@btroncone
Copy link
Owner

Hello @ttmarek,

Another dev ran into a similar issue with ngrx-localstorage. Essentially you need to avoid compose in the module setup in your production builds. Here is the issue: btroncone/ngrx-store-localstorage#13

Let me know if you have any other issues, hope this helps!

@btroncone
Copy link
Owner

Closing as it appears this has been solved 👍

@ttmarek
Copy link
Author

ttmarek commented Nov 30, 2016

Hey sorry about that @btroncone, I completely forgot I opened this. The issue was with exporting the function expression. So we wrapped the meta reducer in another meta reducer that was defined and exported as a function declaration. Here's our documented solution: https://github.com/rangle/angular-2-aot-sandbox/tree/master/tests/ngrx-compose

@btroncone
Copy link
Owner

Awesome, thanks! 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants