moff / angular2-ladda

Angular 2 Ladda module
MIT License
97 stars 20 forks source link

Angular 2 RC6 and Webpack2 #1

Closed Ks89 closed 8 years ago

Ks89 commented 8 years ago

Hi, Is it working with Angular2 RC6 and webpack2? Because I'm receiving this error:

metadata_resolver.js:230Uncaught Error: Unexpected value 'LaddaModule' imported by the module 'AppModule'

I followed your readme to import this library. Also, with RC5 it was working very well.

Thank u.

moff commented 8 years ago

Hi @Ks89 I'll check it today and I'll let you know. Thanks for the feedback.

moff commented 8 years ago

@Ks89 I checked it and I can tell that it works with RC6 - I installed it on top of basic app from here https://angular.io/docs/ts/latest/quickstart.html

I guess it has something to do with Webpack 2.

Can you share your code or give me instructions to reproduce same error?

moff commented 8 years ago

@Ks89 I checked it with Webpack 1 and it works. Here is the Laravel5 + Angular2 boilerplate I used for that check https://github.com/moff/laravel5-angular2/tree/develop

Notice! RC6 has bugs. Here is one of them: https://github.com/angular/angular/issues/11249

I had to set correct value in node_modules/@angular/upgrage/package.json to make it work

Ks89 commented 8 years ago

Hi, I created this small project HERE with angular2 rc6 and webpack 2.1 beta. It's working!

When I uncomment "LaddaModule" in app.module.ts, the html in home.html and "import 'angular2-ladda';" in vendor.ts I receive the same error.

To run the broken example checkout the "broken" branch HERE

Ks89 commented 8 years ago

Hi @moff. there are any news? I updated to Angular 2.0.0 final but it seems still broken.

moff commented 8 years ago

Hi @Ks89. This issue is mainly Webpack 2 related, not Angular. This issue appeared when you started to use Angular RC6 which introduced some changes related to ES2015 modules and tree shaking.

Webpack 2 is still in beta. It's quite normal to face such issues when you use beta-software.

There is a discussion related to that issue at Webpack repository.

Ks89 commented 8 years ago

Yes, I understand. Thank u. I'll check the issue.

moff commented 8 years ago

@Ks89 I'd recommend using Webpack 1. Unless 2nd version is required for some reason in your project.

Ks89 commented 8 years ago

Tested with Webpack2.1.0-beta25 and Angular 2.1.0 and now it's ok.

👍