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

core: session - AOT build fails when a config object is passed to StarkSessionModule.forRoot() #797

Closed
christophercr opened this issue Oct 25, 2018 · 0 comments · Fixed by #799

Comments

@christophercr
Copy link
Collaborator

christophercr commented Oct 25, 2018

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/NationalBankBelgium/stark/blob/master/CONTRIBUTING.md#got-a-question-or-problem

Current behavior

With the changes done in #766, if a custom config is passed to the StarkSessionModule.forRoot() in the client application, the PROD AOT build fails with the following error:

ERROR in Error during template compile of 'StarkSessionModule'
  Function calls are not supported in decorators but 'starkSessionConfigFactory' was called.

The issue is explained here: angular/angular#14707

Expected behavior

The PROD AOT build should succeed regardless of whether a custom config is passed to Stark modules or not.

Minimal reproduction of the problem with instructions

Pass a custom config to the StarkSessionModule.forRoot() in the AppModule for example:

@NgModule({
    bootstrap: [AppComponent],
    declarations: [AppComponent, ...],
    imports: [
        ...
        StarkSessionModule.forRoot({
            loginStateName: "some login state"
        }),
   ],
   providers: [...]
})
export class AppModule { }

What is the motivation / use case for changing the behavior?

Stable and successful PROD AOT builds including Stark modules.

Environment


Angular version: 6.1.9
Stark version: 10.0.0-beta.0

@christophercr christophercr self-assigned this Oct 25, 2018
@christophercr christophercr added this to the 10.0.0-beta.1 milestone Oct 25, 2018
christophercr referenced this issue in christophercr/stark Oct 25, 2018
…o prevent Angular error "Functi

ISSUES CLOSED: #797
christophercr referenced this issue in christophercr/stark Oct 25, 2018
…o prevent Angular AOT error "Function calls are not supported in decorators" in StarkSessionModule.forRoot()

ISSUES CLOSED: #797
christophercr referenced this issue in christophercr/stark Oct 25, 2018
…o prevent Angular AOT error "Function calls are not supported in decorators" in StarkSessionModule.forRoot()

ISSUES CLOSED: #797
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant