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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

@NgModule argument must be an object literal #30840

Closed
konsultaner opened this issue Jun 4, 2019 · 2 comments
Closed

@NgModule argument must be an object literal #30840

konsultaner opened this issue Jun 4, 2019 · 2 comments
Labels
area: core Issues related to the framework runtime
Milestone

Comments

@konsultaner
Copy link

馃悶 bug report

Affected Package

The issue is caused by package @angular/compiler on @angular/core@next and @angular/compiler@8.0.0.

Is this a regression?

works with out ivy enabled

Description

if @NgModule() arguments are passed as variable I get this error

馃敩 Minimal Reproduction

this fails:

const moduleDefinition = {...}

@NgModule(moduleDefinition)
export class AppModule {
    constructor() {}
}

this works:

@NgModule({...})
export class AppModule {
    constructor() {}
}
@mhevery mhevery added the area: core Issues related to the framework runtime label Jun 4, 2019
@ngbot ngbot bot added this to the needsTriage milestone Jun 4, 2019
@alxhub
Copy link
Member

alxhub commented Jun 4, 2019

This is an intentional change in Ivy - we're stricter about the arguments to decorators than View Engine was. It's a requirement for how Ivy compiles decorators (by moving the expressions inside them into other locations in the class output).

@alxhub alxhub closed this as completed Jun 4, 2019
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: core Issues related to the framework runtime
Projects
None yet
Development

No branches or pull requests

3 participants