ngx-pagination icon indicating copy to clipboard operation
ngx-pagination copied to clipboard

Does not work with IVY

Open hadley8899 opened this issue 6 years ago • 5 comments

=======

Angular version: 8.0.0

ngx-pagination version: 4.0.0

Description of issue: When using NGX-Pagination with IVY turned on you get the following error:

ERROR Error: Export of name 'paginationApi' not found! at cacheMatchingLocalNames (core.js:12842) at resolveDirectives (core.js:12616) at createDirectivesAndLocals (core.js:12058) at ɵɵelementStart (core.js:15324) at PaginationControlsComponent_Template (template.html:2) at executeTemplate (core.js:11982) at checkView (core.js:13333) at componentRefresh (core.js:13097) at refreshChildComponents (core.js:11685) at refreshDescendantViews (core.js:11591)

Steps to reproduce:

  1. Create a new Angular 8.0.0 project
  2. Enable IVY by adding "angularCompilerOptions": { "enableIvy": true }, to the tsconfig.app.json file
  3. Install the package and create the sample project as seen in the readme
  4. Load the page

Expected result: Error is not produced and the module works

Actual result: Error message is displayed in the console and the page does not load

hadley8899 avatar Jul 06 '19 13:07 hadley8899

Thanks for the report. As far as I understand, Ivy should be completely backwards-compatible.

We’ll be using the opt-in preview of Ivy in 8.0.0 to validate our promises about backwards compatibility and to work on any automated migration tools we might need. (source: https://blog.angular.io/a-plan-for-version-8-0-and-ivy-b3318dfc19f7)

So perhaps this has uncovered a bug in the ivy backwards-compatibility.

If we look through this thread https://github.com/angular/angular/issues/21706#issuecomment-497388916 then it seems that issues with 3rd party libs are not uncommon with the current implementation of the Ivy preview.

Rather than try to make fixes in this lib against a moving target, I'd rather flag up this issue to the Angular team as a possible example where Ivy is not yet backwards compatible.

Flagging it up via twitter: https://twitter.com/michlbrmly/status/1149604969407844354

michaelbromley avatar Jul 12 '19 09:07 michaelbromley

Right, so Stephen Fluin from the Angular team just said to open a new issue on the Angular repo.

I've not got time right at the moment to put one together including testing the reporduction etc.

If anyone wants to do it (@hadley8899 ?) then just be sure to link back to this issue so we can track it.

michaelbromley avatar Jul 12 '19 18:07 michaelbromley

I have created an issue on the official repo

https://github.com/angular/angular/issues/31540

Also created a basic repo for reproduction

https://github.com/hadley8899/angular-ngx-pagination-ivy-issue

hadley8899 avatar Jul 13 '19 09:07 hadley8899

@hadley8899 thanks, and 💯 quick response from the Angular team!

michaelbromley avatar Jul 15 '19 06:07 michaelbromley

Should be working in 9.0.0-next.2.

Flyrell avatar Nov 07 '19 10:11 Flyrell