Skip to content

@ngtools/webpack: Cannot read property 'forEach' of undefined #5639

@conor-mac-aoidh

Description

@conor-mac-aoidh

Bug Report or Feature Request (mark with an x)

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

Versions.

@angular/cli: 1.0.0
node: 7.7.1
os: linux x64
@angular/animations: 4.0.0
@angular/common: 4.0.0
@angular/compiler: 4.0.0
@angular/compiler-cli: 4.0.0
@angular/core: 4.0.0
@angular/forms: 4.0.0
@angular/http: 4.0.0
@angular/platform-browser: 4.0.0
@angular/platform-browser-dynamic: 4.0.0
@angular/platform-server: 4.0.0
@angular/router: 4.0.0
@angular/cli: 1.0.0

Repro steps.

  • run ng serve

I cannot give exact steps to reproduce.. but my app was working fine on angular 4.0.0-rc.6 and angular-cli 1.0.0-rc.4. As of today I am getting the error below. I have tried reverting to the older versions but the error persists.

I note that the error is thrown in @ngtools/webpack and that there was an update to this 14 hours ago.

The log given by the failure.

ERROR in ./src/app/app.component.ts
Module build failed: TypeError: Cannot read property 'forEach' of undefined
    at Promise.resolve.then.then.then (/home/user/Documents/src/project/my_app/assets/node_modules/@ngtools/webpack/src/loader.js:350:40)
    at process._tickCallback (internal/process/next_tick.js:109:7)
 @ ./src/app/index.ts 1:0-32
 @ ./src/main.ts
 @ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts

Mention any other details that might be useful.

Contents of app.component.ts:

import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  template: `
    <app-header></app-header>
    <app-navigation></app-navigation>
    <app-body></app-body>
    <app-footer></app-footer>
  `,
  styleUrls: []
})
export class AppComponent { }

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