Angular-cli: undefined object. Angular Cli 1.0.0-beta.11-webpack.8

Created on 30 Aug 2016  路  5Comments  路  Source: angular/angular-cli

Please provide us with the following information:

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
    Linux, Ubuntu
  2. Versions. Please run ng --version. If there's nothing outputted, please run
    in a Terminal: node --version and paste the result here:
    angular-cli: 1.0.0-beta.11-webpack.8
    node: 6.5.0
    os: linux x64
  3. Repro steps. Was this an app that wasn't created using the CLI? What change did you
    do on your code? etc.
    After install/update angular cli as in docs
    ng serve
  4. The log given by the failure. Normally this include a stack trace and some
    more information.

Cannot read property 'length' of undefined
TypeError: Cannot read property 'length' of undefined
at Object.getWebpackCommonConfig (/home/reneval/.nvm/versions/node/v6.5.0/lib/node_modules/angular-cli/addon/ng2/models/webpack-build-common.ts:23:25)
at new NgCliWebpackConfig (/home/reneval/.nvm/versions/node/v6.5.0/lib/node_modules/angular-cli/addon/ng2/models/webpack-config.ts:13:30)
at Class.run (/home/reneval/.nvm/versions/node/v6.5.0/lib/node_modules/angular-cli/addon/ng2/tasks/serve-webpack.ts:19:22)
at /home/reneval/.nvm/versions/node/v6.5.0/lib/node_modules/angular-cli/addon/ng2/commands/serve.ts:84:26
at process._tickCallback (internal/process/next_tick.js:103:7)

  1. Mention any other details that might be useful.

Basic code was generated with beta.11-webpack.3

Most helpful comment

I just ran into the same error after incorrectly upgrading to angular-cli version 1.0.0-beta.11-webpack.3 (from 2).
I followed all of the steps carefully at https://github.com/angular/angular-cli#updating-angular-cli and the error went away.
As of today, I had to use [email protected] and not @latest to actually get the latest webpack version. I wonder if you are pulling version 8 from master or some place else..
Be careful to review all files that need to be replaced, modified, or skipped during the re-run of the ng init phase in your existing project.

All 5 comments

I just ran into the same error after incorrectly upgrading to angular-cli version 1.0.0-beta.11-webpack.3 (from 2).
I followed all of the steps carefully at https://github.com/angular/angular-cli#updating-angular-cli and the error went away.
As of today, I had to use [email protected] and not @latest to actually get the latest webpack version. I wonder if you are pulling version 8 from master or some place else..
Be careful to review all files that need to be replaced, modified, or skipped during the re-run of the ng init phase in your existing project.

fixed id #1887 go for my latest comment there !

I had this same issue. I was able to fix it by adding the line below to the angular-cli.json file.

"scripts": [],

These intermediate versions did not have update steps in between them, so it was easy to get stuff broken. Following the instructions in https://github.com/angular/angular-cli#webpack-update should allow you to update projects correctly.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings