Skip to content

(webpack) Cannot import with barrels  #1585

@efriandika

Description

@efriandika

Please look at this code:

import {NavbarComponent, FooterComponent} from './shared/index';

@Component({
    selector: 'app',
    templateUrl: 'app.component.html',
    directives: [NavbarComponent, FooterComponent]
})
export class AppComponent {}

It will get an error: EXCEPTION: Unexpected directive value 'undefined' on the View of component AppComponent'

When I dont use barrels:

import {NavbarComponent} from './shared/navbar/navbar.component';
import {FooterComponent} from './shared/footer/footer.component';

It run properly.

So, what should I do ? Is this a bugs of angular cli ?

Version: angular-cli@webpack
OS: MacOSX El Capitan

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