-
Notifications
You must be signed in to change notification settings - Fork 12k
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
ng build --aot fails #4043
Comments
It looks like the real error is |
Yes I can: import {NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
/**
* Feature Modules
*/
import {CoreModule, PreloadSelectedModulesOnly} from './core';
import {SharedModule} from './shared/shared.module';
/**
* Components
*/
import {AppComponent} from './app.component';
import {LayoutComponent} from './layout/layout.component';
import {HomeComponent} from './home/home.component';
import {NotificationsComponent} from './notifications/notifications.component';
import {RecipesComponent} from './recipes/recipes.component';
import {AccountComponent} from './account/account.component';
import {SettingsComponent} from './settings/settings.component';
import {ErrorComponent} from './error/error.component';
/**
* Routing
*/
import {routing} from './app.routing';
@NgModule({
imports: [
BrowserModule,
// Routing
routing,
// Features/Shared
SharedModule.forRoot(),
CoreModule.forRoot()
],
providers: [PreloadSelectedModulesOnly],
declarations: [
AppComponent,
LayoutComponent,
HomeComponent,
NotificationsComponent,
RecipesComponent,
AccountComponent,
SettingsComponent,
ErrorComponent
],
// A list of components that can be bootstrapped.
// Usually there is only one component in this list,
// the root component of the application.
bootstrap: [
AppComponent
]
})
export class AppModule {} |
Could you show your angular-cli.json ? |
@Shinzah It is an array, yes. But I cannot see how that would have any impact on AOT. I do know that I get an error if I add a folder or file that does not exist in the |
I get the same thing but without the |
I found the issue. It seems like AOT does not like: const providers = [];
if (someCondition) {
providers.push({ ...some object });
}
@NgModule({
providers
})
export class TestModule {} But it works with: const providers = [];
if (someCondition) {
providers.push({ ...some object });
}
@NgModule({
providers: [
...providers
]
})
export class TestModule {} |
HI, i am als0 facing same issue. unfortunately i have closed issue but still i am facing same issue |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
OS?
OS X El Capitan
Versions.
angular-cli: 1.0.0-beta.25.5
node: 6.7.0
os: darwin x64
@angular/common: 2.4.3
@angular/compiler: 2.4.3
@angular/core: 2.4.3
@angular/forms: 2.4.3
@angular/http: 2.4.3
@angular/platform-browser: 2.4.3
@angular/platform-browser-dynamic: 2.4.3
@angular/router: 3.4.3
@angular/material: 2.0.0-beta.1
Repro steps.
If I run
ng build --aot
it throws an error after it logs the bundles that were created.The log given by the failure.
Mention any other details that might be useful.
The text was updated successfully, but these errors were encountered: