Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CAPTCHA Widget is doesn't work with ng build --prod, specifically the --aot flag. #3

Closed
acoard opened this issue Sep 15, 2017 · 2 comments
Assignees
Labels

Comments

@acoard
Copy link
Contributor

acoard commented Sep 15, 2017

Versions
Ran in the the folder of a fresh clone of angular-scaffold

@angular/cli: 1.1.3
node: 7.6.0
os: darwin x64
@angular/common: 4.2.4
@angular/compiler: 4.2.4
@angular/compiler-cli: 4.2.4
@angular/core: 4.2.4
@angular/forms: 4.2.4
@angular/http: 4.2.4
@angular/platform-browser: 4.2.4
@angular/platform-browser-dynamic: 4.2.4
@angular/router: 4.2.4
@angular/cli: 1.1.3

Current Behaviour

With the widget installed and used in bcgov/angular-scaffold the ng build --prod command fails with the following error:

ERROR in Unexpected value 'undefined' declared by the module 'AppModule in .../mygov/angular-scaffold/src/app/app.module.ts'

ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '.../mygov/angular-scaffold/src'
 @ ./src/main.ts 3:0-74
 @ multi ./src/main.ts

This command also happens if you run ng build --aot=true. The --prod flag is shorthand for a bunch of other flags, and after some trial and error I found out it was only the --aot flag which was an issue. (ng build --prod --aot=false compiles fine).

Desired Behaviour

An angular-scaffold project can run ng build --prod when using the CAPTCHA widget.

Steps to Reproduce

  1. Clone angular-scaffold
  2. yarn add git+https://github.com/bcgov/MyGovBC-CAPTCHA-Widget.git
  3. Add CaptchaComponent to app.module.ts, copying directly from the readme.
  4. Modify app.component.html, replacing <router-outlet> with the CAPTCHA snippet from the readme.
  5. Run ng build --prod

If you have any questions let me know. The above notwithstanding it's a great widget, thanks for making it.

@GregTurner GregTurner added the bug label Sep 15, 2017
@GregTurner
Copy link
Contributor

Thanks @acoard for reporting, I've recreated the issue as reported.

@acoard
Copy link
Contributor Author

acoard commented Oct 5, 2017

This has been resolved by Yiling in version 2.0.8. Just update your package.json and you're good to go.

Note: README has not been updated, so look at angular-scaffold-captcha for example on how to integrate.

@acoard acoard closed this as completed Oct 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants