rnadler / ng2-password-strength-bar

Angular 2/4/5 Password Strength Bar
http://bobonmedicaldevicesoftware.com/blog/2016/12/09/publishing-an-angular-2-component-npm-package/
MIT License
20 stars 16 forks source link

Not compatible with Anuglar 9.1 and Ivy #26

Open patrickrioux opened 4 years ago

patrickrioux commented 4 years ago

When upgrading from Angular 8 to 9.1 the compiler give that error.

This likely means that the library (ngx-store) which declares WebStorageModule 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.

Any idea?

onilleksh commented 4 years ago

@patrickrioux any update on this. I am facing the same issue

node_modules/ng2-password-strength-bar/lib/passwordStrengthBar.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 (ng2-password-strength-bar) which declares PasswordStrengthBarModule 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.

I have updated my application to Angular 9. And this is what I am getting while building the application.

Angular CLI: 9.1.1 Node: 12.16.2 OS: linux x64

Angular: 9.1.1 ... 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.901.1 @angular-devkit/build-angular 0.901.1 @angular-devkit/build-optimizer 0.901.1 @angular-devkit/build-webpack 0.901.1 @angular-devkit/core 9.1.1 @angular-devkit/schematics 9.1.1 @angular/cdk 9.2.0 @angular/material 9.2.0 @angular/material-moment-adapter 8.2.3 @ngtools/webpack 9.1.1 @schematics/angular 9.1.1 @schematics/update 0.901.1 rxjs 6.5.5 typescript 3.8.3 webpack 4.42.1

I was able to fix the same error for primeng by just updating its version to latest. Looking for a reply soon...

patrickrioux commented 4 years ago

As a work around, I have replaced that component in favor or password-strength-meter. This one provide similar functionalities and compiled ok with A9.

onilleksh commented 4 years ago

@patrickrioux thank you for sharing

patrickrioux commented 4 years ago

https://github.com/antoantonyk/password-strength-meter

Patrick

rnadler commented 4 years ago

It appears to be impossible to create a single library that supports both pre-A9 and A9 at the same time. I just punted and created https://www.npmjs.com/package/ng9-password-strength-bar. Updating the ng2 component to ng9 is a couple of simple name changes.

If you have a chance to try it out, let me know if you run into any problems. Thanks!

jhkueh commented 4 years ago

It appears to be impossible to create a single library that supports both pre-A9 and A9 at the same time. I just punted and created https://www.npmjs.com/package/ng9-password-strength-bar. Updating the ng2 component to ng9 is a couple of simple name changes.

If you have a chance to try it out, let me know if you run into any problems. Thanks!

What other libraries normally do is that they made some breaking changes.

So for ng2-password-strength-bar (which should probably be named "ng-password-strength-bar"), maybe we can designate version 2 to support Angular 9+ & version 1 to support pre-Angular 9?

P. S. Sorry, I had been busy to go around making the PR for Angular 9 support.

rnadler commented 4 years ago

I thought about ending the ng2 line, but it still gets ~2000 downloads/week and even if there's only a remote possibility of making changes to it, I didn't want to close that door (yet).

BTW: There is an angular9-support branch in this repo that works.