xmaestro / angular2-recaptcha

Angular 2 : Typescript component for Google reCaptcha
ISC License
79 stars 30 forks source link

0.3.1 update with latest angular-cli (webpack-based) results in an error #33

Closed vkniazeu closed 8 years ago

vkniazeu commented 8 years ago

Updated to 0.3.1. Cleaned npm cache. Uninstalled, reinstalled several times. The following error remains. 0.3.0 works without an issue.

ERROR in ./~/angular2-recaptcha/index.js
Module not found: Error: Can't resolve './angular2-recaptcha' 
     in 'C:\...\node_modules\angular2-recaptcha'
 @ ./~/angular2-recaptcha/index.js 5:9-40
 @ ./src/app/app.module.ts
 @ ./src/app/index.ts
 @ ./src/main.ts
 @ multi main
vkniazeu commented 8 years ago

Is "rxjs": "^5.0.0-beta.12" a requirement to use 0.3.1, perhaps? There's a known bug with 12, which prevents firebase auth working with it. I'm on "rxjs": "5.0.0-beta.10", could that be the problem?

achimha commented 8 years ago

Angular 2.0.0 has a dependency on 5.0.0-beta.12 and we have a dependency on Angular 2.0.0 so yes, you need beta 12.

vkniazeu commented 8 years ago

@achimha, thank you for a very quick reply!

I will play around with it to try to get rxjs updated to the latest version. Most recently there was an issue with zones not detecting auth changes with angularfire/firebase if beta 12 was used.

However, as I understand it, the internal Angular 2.0.0 or node_modules module dependency should NOT affect the project dependencies or dev dependencies. recapctcha can be built with 5.0.0-beta.12, but that shouldn't prevent me from using 5.0.0-beta.10 in my project if I need to for other reasons, should it? I mean I have had Angular 2.0.1 working perfectly fine while having rxjs 5.0.0-beta.10 for my own reasons as my own project dependency. And that set up worked fine with angular2-recaptcha 0.3.0, but doesn't with 0.3.1. Could it be something else, perhaps?

achimha commented 8 years ago

Indeed, I am not aware of anything in rxjs beta 12 that would require it to be used but we obviously don't test this combination.

I don't know what causes your error, it does not look related to rxjs or the recent change.

vkniazeu commented 8 years ago

I'll try to get it resolved tomorrow then and update this issue so it can be closed. Thank you for a great and easy to use module!

xmaestro commented 8 years ago

@vkniazeu This probably happened because of a missing compiled js file (angular2-recaptcha.js). For some reason, the file did not get published. I have upgraded to Angular 2.0.1 and after publishing it doesn't seem to be a problem anymore. Let's re-open this issue if you still face it after upgrade to 0.3.2.

vkniazeu commented 8 years ago

@xmaestro yes, that was the problem. 0.3.2 works like a charm. Thank you for a quick fix!