bluehalo/ngx-leaflet

Compile With Ivy fails

Frooger opened this issue · 7 comments

Before submitting an issue, please verify the following:

If this is a request for help, please use Stack Overflow and use the ngx-leaflet tag, or review the Getting Help section of the README. We watch the ngx-leaflet tag on Stack Overflow and will respond there. We will no longer be responding to help and 'how-to' requests on GitHub.

If this is a bug, issue, enhancement request, etc. verify the following before submitting your issue:

  • [x ] Review the README to see if your issue is covered, and pay particular attention to the Getting Help section.
  • [x ] Tell us what version of Leaflet, Angular, and ngx-leaflet you're using
  • [x ] Include code that reproduces your issue
    I'm using:
    angular 11.0.7
    leaflet 1.7.1
    ngx-leaflet 8.1.0
    rxjs 6.6.3

I changed the angular compiler from View Engine to Ivy and notice an Error on ng build --prod --aot

Error: Symbol LeafletDirective declared in /node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts is not exported from @asymmetrik/ngx-leaflet/dist/leaflet/leaflet.module (import into .../myComponent.component.ts)

Can somebody help ?

For Angular 10, the recommendation for components (I think) was to disable Ivy when building the component library. I need to dig into the docs for v11 to understand if this has changed. This should hopefully be soon.

Oki, Im not sure i did it get. I downgraded now to Angular 10. But do you plan leaflet be useable with the ivy Compiler in the future ?

I am working on a solution now. The plan is to support Ivy projects.

Thx 👍

So, I've dug into this more. I thought originally it was cause I've got my own homemade build that doesn't use ng-packagr. But, I went back and wasn't able to reproduce this error with a fresh created Angular 11 project and the latest ngx-leaflet library.

I'm able to successfully serve the dev server and build the prod/aot build.

Is this a new repo? Are you sure you're running the right version of the angular cli globally and/or in the project?

Can you recreate this issue in a standalone repo you can share with me?

Hi @reblace thanks you so much for the support !
do you could share the repo with me where you tested it maybe i can then reproduce the error or find out why I get the error in my private repo.