Skip to content

Unexpected value 'TickTockModule' imported by the module 'Feature1RoutingModule'. Please add a @NgModule annotation #8

Open
@unsafecode

Description

@unsafecode

Description

I'm facing this error when trying to import TickTockModule in a Angular CLI project, via a lazy-loaded module:

Unexpected value 'TickTockModule' imported by the module 'Feature1RoutingModule'. Please add a @NgModule annotation (happens when I navigate the lazy route)

Feature1RoutingModule was created via CLI and is defined as follows:

import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import { TickTockComponent, TickTockModule } from "@unsafecode/feature1";

const routes: Routes = [
  {
    path: '',
    component: TickTockComponent
  }
];

@NgModule({
  imports: [RouterModule.forChild(routes), TickTockModule],
  exports: [RouterModule]
})
export class Feature1RoutingModule { }

Where @unsafecode/feature1 is the library package, cloned from this repo and linked with npm link (no changes).

I also checked the Angular CLI project tsconfig.json has the paths: {...} options configured as described.

Configuration

node@8.4.0
npm@5.3.0
@angular/cli@1.3.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions