Skip to content

AoT compiling not working #15

@lujakob

Description

@lujakob

Hi,
I got a question regarding AoT compiling an app using the angular2-redux package. JiT compiling works for my Ionic2 app, but the AoT compiling used for the "ionic build ios" is not working. If I create the AppStore in app.module.ts as in your package example

export const appStoreFactory = createAppStoreFactoryWithOptions({ reducers, additionalMiddlewares: [], debug: true });
providers: [ {provide: AppStore, useFactory: appStoreFactory }]

then JiT compiling works, but AoT compiling throws the following error:

Error: Error encountered resolving symbol values statically. Calling function
'createAppStoreFactoryWithOptions', function calls are not supported. Consider replacing the function or
lambda with a reference to an exported function, resolving symbol appStoreFactory in
/Users/luki/work/kunden/valtech/bmg/mybmg-mobileapp/git/mybmg-mobileapp/.tmp/app/app.module.ts, resolving
symbol AppModule in

If I change the "appStoreFactory" to a function as follows:

export function appStoreFactory () { return createAppStoreFactoryWithOptions({ reducers, additionalMiddlewares: [], debug: true }); }

then the AoT is working (JiT is not working like this) but I get the following error in Xcode Debug when I start the app on my iPhone, that is catched in the catch part of my this.platform.ready() promise:

2016-11-23 19:02:04.933 myBMG[5739:2741555] reject: TypeError: t.appStore.select is not a function. (In 't.appStore.select(c.b)', 't.appStore.select' is undefined)
2016-11-23 19:02:04.937 myBMG[5739:2741555] reject: TypeError: t.appStore.dispatch is not a function. (In 't.appStore.dispatch(t.userActions.alreadyLoggedIn())', 't.appStore.dispatch' is undefined)

Any ideas about using angular2-redux with AoT ?
Thanks a lot for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions