angular-cli: [RC6 Update w/ webpack 2.1.0-beta.21 incompat] Uncaught TypeError: Cannot read property 'Emulated' of undefined

Please provide us with the following information:

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?) Windows 10 Pro x64 Build 14393.rs1_release_inmarket.160819-1924
  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: local (v1.0.0-beta.11-webpack.8, branch: master) node: 6.3.1 os: win32 x64
  3. Repro steps. Was this an app that wasn’t created using the CLI? What change did you do on your code? etc. $ ng new Upgrade to rc.6 $ ng serve Error appears when opening in browser
  4. The log given by the failure. Normally this include a stack trace and some more information. config.js:15Uncaught TypeError: Cannot read property ‘Emulated’ of undefinedCompilerConfig @ config.js:15(anonymous function) @ compiler.js:75__webpack_require__ @ bootstrap 76af11c…:52(anonymous function) @ main.bundle.js:50229__webpack_require__ @ bootstrap 76af11c…:52(anonymous function) @ main.bundle.js:13600__webpack_require__ @ bootstrap 76af11c…:52(anonymous function) @ main.bundle.js:56646__webpack_require__ @ bootstrap 76af11c…:52(anonymous function) @ main.bundle.js:56624__webpack_require__ @ bootstrap 76af11c…:52(anonymous function) @ version.js:1__webpack_require__ @ bootstrap 76af11c…:52(anonymous function) @ main.bundle.js:67347__webpack_require__ @ bootstrap 76af11c…:52webpackJsonpCallback @ bootstrap 76af11c…:23(anonymous function) @ main.bundle.js:1
  5. Mention any other details that might be useful.

Thanks! We’ll be in touch soon.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 13
  • Comments: 21 (5 by maintainers)

Commits related to this issue

Most upvoted comments

@richavyas go to node_modules/angular-cli npm install webpack@2.1.0-beta.22 --save this will update webpack installation in angular-cli.

Good god… I can’t wait until all of the various moving pieces for Angular 2 get locked down - between fighting with AngularCLI versions, Typescript versions (can’t use 2.0.2, that breaks, gotta lock it to 2.0.0), and Angular itself (RC6), trying to get a dev environment set up is an exercise in futility! (my company is looking into Angular 2 for it’s next dev platform, and having to say well there are all these issues just to get started, makes one want to look at other, more stable, platforms!)

I’m not using angular-cli (using webpack directly) and I’ve encountered the same issue. Verifying that I have the right versions of node/npm/typescript didn’t help, the only thing that solved it is changing the tsconfig "module": "es6", --> "module": "commonjs", I’m writing this here since google sends people searching for “Cannot read property ‘Emulated’ of undefined” here. This issue is weird since I have another project that works with the same configuration + es6 module, same machine and there are no issues… This is probably a webpack2 issue so someone probably should to open an issue there.

Listen up

😄 This issue was caused by webpack not being able to handle deep namespaced reexports appropriately (packages got rearranged for RC6) while trying to treeshake: see #2953

Updating to webpack@2.1.0-beta.22 will solve this issue.

This issue is also fixed on master for the CLI as of yesterday #2011.

Hi @hassanasad ,

updating NodeJS had no effect on my machine. Can you explain why NodeJS and the compilation process could be related.

Holy heck this is a mess.

Angular-CLI does not yet work with Angular 2 RC6. See #1937 and the latest comments in #1901

@TheLarkInn I am using the current master branch, generate a brand new “angular2” project, run ng serve, still get the same error. config.js:15Uncaught TypeError: Cannot read property 'Emulated' of undefined

I checked my angular-cli project dependency webpack is beta.22, but inside the newly generated project using angular-cli dependency beta.8. so it is still using webpack beta 11.

 ng serve
** NG Live Development Server is running on http://localhost:4200. **
3512ms building modules                 2ms add01521ms 882ms asset39ms emittinggHash: 4993f7e77698840ac956
Version: webpack 2.1.0-beta.21

Should you cut a new release like angular-cli beta.9, so it gets the latest webpack 2.1.0-beta.22? Or tried with installing local webpack beta.22, but it seems that it only takes from angular-cli internal webpack dependency