Skip to content

1.6.0-beta.0: Unexpected value 'e' imported by the module 'e'. Please add a @NgModule annotation. #8391

@AndreyKotofotoff

Description

@AndreyKotofotoff

Uncaught Error: Unexpected value 'e' imported by the module 'e'. Please add a @NgModule annotation.

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

Angular CLI: 1.6.0-beta.0
Node: 8.8.1
OS: win32 x64
Angular: 5.0.0

Repro steps.

ng serve - OK
ng serve --prod --aot=false - ERROR

The log given by the failure.

App.module.ts
import 'moment';

import { HashLocationStrategy, LocationStrategy } from '@angular/common';
import { APP_BASE_HREF } from '@angular/common';
import { NgModule } from '@angular/core';
import { BrowserModule, Title } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

import { MNTR_API_URL } from '../config';
import { environment } from '../environments/environment';
import { AppComponent } from './app.component';
import { NavService } from './core';

@NgModule({
bootstrap: [AppComponent],
declarations: [AppComponent],
imports: [
BrowserModule,
BrowserAnimationsModule
],
providers: [
NavService,
Title,
{ provide: MNTR_API_URL, useValue: environment.API_URL },
{ provide: APP_BASE_HREF, useValue: "/" },
{ provide: LocationStrategy, useClass: HashLocationStrategy }
]
})
export class AppModule { }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions