Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Getting AoT working #540

@qdouble

Description

@qdouble
  • I'm submitting a ...
  • [x ] bug report
  • What modules are related to this Issue?
  • [x ] universal
  • What is the current behavior?
    When trying to use ngc on Universal project, I get the following error:

Error: Unexpected value 'UniversalModule' imported by the module 'AppModule'

at /Users/qdouble/Sites/EXAMPLE_APPS/angular2webpack2-starter/node_modules/@angular/compiler/bundles/compiler.umd.
js:14126:37
at Array.forEach (native)
at CompileMetadataResolver.getNgModuleMetadata (/Users/qdouble/Sites/EXAMPLE_APPS/angular2webpack2-starter/node_mo
dules/@angular/compiler/bundles/compiler.umd.js:14111:46)
at /Users/qdouble/Sites/EXAMPLE_APPS/angular2webpack2-starter/node_modules/@angular/compiler/bundles/compiler.umd.
js:12952:58
at Array.forEach (native)
at OfflineCompiler.analyzeModules (/Users/qdouble/Sites/EXAMPLE_APPS/angular2webpack2-starter/node_modules/@AnGula
r/compiler/bundles/compiler.umd.js:12951:21)
at CodeGenerator.codegen (/Users/qdouble/Sites/EXAMPLE_APPS/angular2webpack2-starter/node_modules/@angular/compile
r-cli/src/codegen.js:105:47)
at codegen (/Users/qdouble/Sites/EXAMPLE_APPS/angular2webpack2-starter/node_modules/@angular/compiler-cli/src/main
.js:7:81)
at Object.main (/Users/qdouble/Sites/EXAMPLE_APPS/angular2webpack2-starter/node_modules/@angular/tsc-wrapped/src/m
ain.js:30:16)
at Object. (/Users/qdouble/Sites/EXAMPLE_APPS/angular2webpack2-starter/node_modules/@angular/compiler-c
li/src/main.js:14:9)
Compilation failed.

this is the module:

import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { UniversalModule } from 'angular2-universal';

import { APP_DECLERATIONS } from './app.declerations';
import { APP_IMPORTS } from './app.imports';
import { APP_PROVIDERS } from './app.providers';

import { AppComponent } from './app.component';
import { routes } from './app.routing.universal';

@NgModule({
  declarations: [
    AppComponent,
    APP_DECLERATIONS
  ],
  imports: [
    APP_IMPORTS,
    RouterModule.forRoot(routes), // Move to APP_IMPORTS if routes are same in all environments
    UniversalModule // NodeModule, NodeHttpModule, and NodeJsonpModule are included
  ],
  bootstrap: [AppComponent],
  providers: [APP_PROVIDERS]
})
export class AppModule { }

  • Angular version: 2.0.0-final
  • Language: [TypeScript 2.0.2 ]
  • OS: [Mac OS X ]

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