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) issue #61

Closed
jongbonga opened this issue Jan 27, 2020 · 19 comments
Closed

Angular 9 (Ivy) issue #61

jongbonga opened this issue Jan 27, 2020 · 19 comments

Comments

@jongbonga
Copy link

jongbonga commented Jan 27, 2020

ERROR in node_modules/angular-cc-library/lib/directives.d.ts:1:22 - error NG6002: Appears in the NgModule.imports of CCPageModule, but could not be resolved to an NgModule class
Angular CLI: 9.0.1
Node: 10.16.0
OS: darwin x64

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

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.803.25
@angular-devkit/build-angular     0.900.1
@angular-devkit/build-optimizer   0.900.1
@angular-devkit/build-webpack     0.900.1
@angular-devkit/core              9.0.1
@angular-devkit/schematics        9.0.1
@angular/cli                      9.0.1
@ngtools/webpack                  9.0.1
@schematics/angular               8.1.3
@schematics/update                0.900.1
rxjs                              6.5.4
typescript                        3.7.5
webpack                           4.41.2
@jongbonga jongbonga changed the title Angular 9 issue Corejs 9 issue Jan 28, 2020
@jongbonga jongbonga changed the title Corejs 9 issue Angular 9 issue Jan 28, 2020
@jongbonga jongbonga changed the title Angular 9 issue Angular 9 (Ivy) issue Jan 28, 2020
@aserralta
Copy link

I have the same issue as @jongbonga

@antoine-souesme
Copy link

Same issue here.

@DanWebb
Copy link

DanWebb commented Feb 12, 2020

I think I'm seeing the same issue but with a different error message:

Importing CreditCardDirectivesModule which does not have a ɵmod property

Unexpected value 'CreditCardDirectivesModule' imported by the module 'ControlCardNumberModule'. Please add an @NgModule annotation.

I was able to fix it by manually re-creating this module...:

import { NgModule } from '@angular/core';
import { CreditCardFormatDirective, ExpiryFormatDirective, CvcFormatDirective } from 'angular-cc-library';

const CREDIT_CARD_LIBRARY_DIRECTIVES = [
  CreditCardFormatDirective,
  ExpiryFormatDirective,
  CvcFormatDirective
];

@NgModule({
  declarations: [CREDIT_CARD_LIBRARY_DIRECTIVES],
  exports: [CREDIT_CARD_LIBRARY_DIRECTIVES]
})
export class CreditCardDirectivesModule {}

// Then...

@NgModule({
  imports: [CreditCardDirectivesModule, /* Other imports... */],
  // etc...
})
export class MyCustomModule { }

I guess it's some issue with the way the libraries built...?

@jongbonga
Copy link
Author

jongbonga commented Feb 12, 2020

@DanWebb are you able to run it with ivy enabled after your fix?

I guess @nogorilla is not maintaining the library anymore... some issues from 2018 are still unanswered.

We are on our own people ✊🏼☹️

@DanWebb
Copy link

DanWebb commented Feb 12, 2020

Sorry @jongbonga spoke too soon the above fails on a prod build in v9, it fooled me because it passed tests.

I'm sure it'll be something to do with how the libraries built or exported though.

@jongbonga
Copy link
Author

I don’t want to get rid of this library since all the others are not satisfying my needs! But also, Can’t rock A9 without Ivy... it doesn’t make sense to me.

Any other cc validation as good as this one? that compile with Ivy? Thanks for sharing 🙂

@DanWebb
Copy link

DanWebb commented Feb 13, 2020

I've put some time into investigating and I think the issue is to do with the .metadata.json file not being in the root directory of the package https://unpkg.com/browse/angular-cc-library@1.2.5/

Anyway, there are lots of other similar occurrences coming up since the v9 release...

I'm out of time and none of the listed solutions have worked so if nobody else has an idea I suppose it'll have to be left for a bit until enough people bring it up for an official solution to be released or an alternative lib is written...

@antoine-souesme
Copy link

antoine-souesme commented Feb 14, 2020

Yes, for now we can just upgrade angular to 9.x and disable Ivy...

@rkajbaf
Copy link

rkajbaf commented Feb 21, 2020

It would be great to be able to use this with Ivy... for now I've removed this library but will gladly add it back into my project once this is fixed.

FWIW I think all that has to happen is that the package needs to be redeployed in a non minified fashion.

@antoine-souesme
Copy link

Unfortunately this library does not seem to be maintained anymore..

@thehashrocket
Copy link

would it make sense to fork it and do the necessary updates?

@EfraimLA
Copy link

So we should leave this library for Ivy?

@timofei-iatsenko
Copy link
Owner

will be fixed when this PR gets merged #64

@EfraimLA
Copy link

Cool, so close issue?

@born2net
Copy link

same issue... fixed?
TX!

@timofei-iatsenko
Copy link
Owner

The PR is merged, and will be included in upcoming release with some other features

@born2net
Copy link

tx!

@jongbonga
Copy link
Author

Thanks @thekip

@timofei-iatsenko timofei-iatsenko mentioned this issue Mar 31, 2020
19 tasks
@timofei-iatsenko
Copy link
Owner

Fixed in 2.0.0 https://github.com/nogorilla/angular-cc-library/releases/tag/v2.0.0

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

9 participants