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

Angular 9 - Ivy compatibility #168

Closed
2 of 4 tasks
GabDug opened this issue Feb 19, 2020 · 11 comments
Closed
2 of 4 tasks

Angular 9 - Ivy compatibility #168

GabDug opened this issue Feb 19, 2020 · 11 comments

Comments

@GabDug
Copy link

GabDug commented Feb 19, 2020

Summary

I'm submitting a:

  • bug report
  • feature request
  • question
  • other

Description

Right now, we have when using ng-recaptcha with Angular 9, you get a warning warning " > [email protected]" has incorrect peer dependency "@angular/core@^6.0.0 || ^7.0.0 || ^8.0.0"..

There are no errors and everything work expected (for us), when using ng-recaptcha with ReCAPTCHA v2 on our Angular 9 codebase but only this warning.

I don't know if the module needs more work for Angular 9 full compatibility, or if only the dependency version should be bumped if everything works as expected.

Does anybody has more information regarding Angular 9/Ivy and ng-recaptcha?
Thanks in advance!

  • ng-recaptcha: 5.0.0
  • Angular: 9.0.22
  • Typescript (tsc --version): 3.7.5
@Toktik
Copy link

Toktik commented Feb 29, 2020

With ivy enabled we are getting errors while importing the module. Ng-recaptcha must generate proper .metadata.json file.

@ezequieltejada
Copy link

ezequieltejada commented Mar 19, 2020

I have this error:

ERROR in node_modules/ng-recaptcha/recaptcha/recaptcha-v3.module.d.ts:1:22 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class.

This likely means that the library (ng-recaptcha) which declares RecaptchaV3Module has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

1 export declare class RecaptchaV3Module {
                       ~~~~~~~~~~~~~~~~~
src/app/app.module.ts:41:14 - error NG6002: Appears in the NgModule.imports of AppServerModule, but itself has errors

Angular CLI: 9.0.6
Node: 12.16.1
OS: linux x64

Angular: 9.0.6
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, platform-server, router
Ivy Workspace: Yes

Package Version

@angular-devkit/architect 0.900.6
@angular-devkit/build-angular 0.900.6
@angular-devkit/build-optimizer 0.900.6
@angular-devkit/build-webpack 0.900.6
@angular-devkit/core 9.0.6
@angular-devkit/schematics 9.0.6
@ngtools/webpack 9.0.6
@nguniversal/builders 9.0.2
@nguniversal/common 9.0.2
@nguniversal/express-engine 9.0.2
@schematics/angular 9.0.6
@schematics/update 0.900.6
rxjs 6.5.4
typescript 3.7.5
webpack 4.41.2

@castevinz
Copy link

How can I help to fix this module import in an angular 9 codebase with Ivy activated ?
Thx in advance ;)

@castevinz
Copy link

When I drop "forRoot" on RecaptchaModule import, it's working with Ivy !
7fb97fb

@samudiogo
Copy link

For some reason, even removing "forRoot" I got a new error:

ERROR Error: Uncaught (in promise): NullInjectorError: R3InjectorError(AuthModule)[RecaptchaComponent -> RecaptchaComponent -> RecaptchaComponent -> RecaptchaComponent]:
NullInjectorError: No provider for RecaptchaComponent!
NullInjectorError: R3InjectorError(AuthModule)[RecaptchaComponent -> RecaptchaComponent -> RecaptchaComponent -> RecaptchaComponent]:
NullInjectorError: No provider for RecaptchaComponent!

But if I set enableIvy to false, works fine only for Recaptcha, but raise errors with components compiled with Ivy

tsconfig.json:
"angularCompilerOptions": { "enableIvy": true }

@avinashroy
Copy link

I just killed the dev server and started again and it worked. I had faced the same issue with other library and did the same 👍

@BruneXX
Copy link

BruneXX commented Aug 21, 2020

Hi Guys, currently I'm trying to update to angular v10.x but this is a constraint to do it, will you add support for new angular versions in the near future?

@DethAriel
Copy link
Owner

DethAriel commented Sep 10, 2020

Hey folks!

ng-recaptcha has been updated. v6.0.0 contains changes to make declared package dependency versions compatible with Angular 9 and Angular 10. I'm sorry it took so long to do this, but I hope this comes as good news to you 😀 Please do submit bug reports if you find any (hopefully not, though).

Cheers!

@sysmat
Copy link

sysmat commented Nov 11, 2021

Generating browser application bundles (phase: setup)...Processing legacy "View Engine" libraries:

ng-recaptcha [es2015/esm2015] (git+https://github.com/DethAriel/ng-recaptcha.git)

Encourage the library authors to publish an Ivy distribution.

ng13

@mbuku
Copy link

mbuku commented Jan 16, 2024

Hi
Any help please. i try to import ng-recaptcha but i find the issue below:

'ReCaptchaV3Service' does not appear to be an NgModule class.(-996002)
recaptcha-v3.service.d.ts(23, 28): This likely means that the library (ng-recaptcha) which declares ReCaptchaV3Service is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

i use angular 17, node 20.0.x, npm 10.0.x

thanks for your help in advance!

@DethAriel
Copy link
Owner

@mbuku feel free to open a new issue. Please also specify the version of ng-recaptcha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants