Skip to content

Cannot Redefine Property error importing @angular/core library. #2953

@TheLarkInn

Description

@TheLarkInn

I'm submitting a bug report

Webpack version:
webpack@2.1.0-beta.21

Please tell us about your environment:
OSX 10.x

Current behavior:
It appears that since @angular/core package has updated to RC6, there has been some reworking of how the packages are structure (ESM, etc.).

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

console.log(ViewEncapsulation);

I receive the following errors in my console:

screen shot 2016-09-03 at 10 36 37 pm

screen shot 2016-09-03 at 10 36 40 pm

Expected/desired behavior:
That there would be no error, and that importing this exported member would not be undefined.

This is critical for the AngularCLI to use with angular RC6. I'm cc'ing @robwormald who has also been trying to hunt down this issue. We have both been unsure if we missed a case for harmony namespace exports with named reexports underneath nested.

The named export mentioned is originally defined here and is then rexported up a level here which is then namespaced reexported here.

This was part of a major package overhaul by @mhevery in angular/angular@9796579.

To Reproduce:

  • git clone https://github.com/TheLarkInn/webpack-developer-kit && cd webpack-developer-kit && git checkout experiment/show_beta_21_bug && npm install && npm run dev
  • Open browser and inspect console
  • See error there.
  • **Interesting information: *
    This still appropriately works on downgrade to webpack@2.1.0-beta.19 so I assume it is a change from there till .21.
  • Browser: [all]
  • Language: [all|TypeScript|ES6/7|ES5]

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions