Closed PostImpatica closed 7 years ago
thanks for this :) it worked for me when I got errors in angular-cli as well. The issue was closed but I think there's still an issue here with this project and AOT:
Cannot read property 'ReCaptchaComponent' of undefined, resolving symbol ReCaptchaModule.
@intellix and @helzgate What changes do you suggest I should make to accommodate AOT? Unfortunately, I'm not using Angular with AOT which puts me at a disadvantage. I have already added factory files.
Same issue here.
With Angular 2.4.0 and angular-cli 1.0.0-beta24, I have no problems using this module with AOT.
@xmaestro, Are you going to fix it?
@eranat Apparently, there is nothing to fix. As @achimha said, it works fine with 2.4.
I'm also working with 2.4.0 and it is not working for me. When I'm running the command: "node_modules/.bin/ngc" -p tsconfig-aot.json
I'm getting the error: Can't export value ReCaptchaModule in ../node_modules/angular2-recaptcha/angular2-recaptcha.js from SharedModule in ../app/shared/shared.module.ts as it was neither declared nor imported!
"dependencies": "@angular/common": "^2.4.0", "@angular/compiler": "^2.4.0", "@angular/compiler-cli": "^2.4.0", "@angular/core": "^2.4.0", "@angular/forms": "^2.4.0", "@angular/http": "^2.4.0", "@angular/platform-browser": "^2.4.0", "@angular/platform-browser-dynamic": "^2.4.0", "@angular/platform-server": "^2.4.1", "@angular/router": "^3.4.0", "@angular/upgrade": "^2.4.1", "angular2-recaptcha": "^0.3.6",
Please provide a reproduction testcase in a github repo.
I have no problems using angular-cli and AOT.
If anyone else gets this error, I figured I'd post my fix to save you time. I had the following error:
Module not found: Error: Can't resolve '../../../../../node_modules/angular2- recaptcha/lib/captcha.component.ngfactory' in '<some path>/<some component>'
I removed the ReCaptcha module and instead manually pull in the service and the component and now everything builds properly.
'angular2-recaptcha/lib/captcha.component',
'angular2-recaptcha/lib/captcha.service',
I'm using the qdouble/angular-webpack2-starter