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

ngx-sharebuttons does not support Ivy #523

Closed
1 task done
Laurent02 opened this issue Dec 16, 2020 · 12 comments
Closed
1 task done

ngx-sharebuttons does not support Ivy #523

Laurent02 opened this issue Dec 16, 2020 · 12 comments
Labels

Comments

@Laurent02
Copy link

I am submitting a

  • Feature Request

Description

When using Ivy, an application no longer compiles well with ngx-sharebuttons. (Error on Stackblitz, on dev machine no warnings whatsoever, but no share buttons either. Took me a while).

What is the use-case or motivation for the new feature?

Using Ivy should be the recommended setting for any new Angular application.

Which versions are you using for the following packages?

ngx-sharebuttons: 8.0.5

Is there anything else we should know?

Check https://stackblitz.com/edit/angular-edbc2e?file=src/app/app.module.ts
I used the same Angular versions as in my project.

@MurhafSousli
Copy link
Owner

MurhafSousli commented Dec 17, 2020

can you try with 8.0.4? and tell me if it is working or not

@Omar-Salem
Copy link

can you try with 8.0.4? and tell me if it is working or not

had the same issue, using 8.0.4 fixed it

@Laurent02
Copy link
Author

can you try with 8.0.4? and tell me if it is working or not

8.0.4 fixes it indeed. Using this version for now until it's fixed. Thanks for you awesome work on this nice handy package!

@MurhafSousli
Copy link
Owner

MurhafSousli commented Dec 19, 2020

@Omar-Salem @Laurent02 I tried to build the demo with v8.0.5 and it works fine! what is the ivy error that you got?

@Omar-Salem
Copy link

@MurhafSousli No directive found with exportAs 'shareButton'.

@Laurent02
Copy link
Author

@Omar-Salem @Laurent02 I tried to build the demo with v8.0.5 and it works fine! what is the ivy error that you got?

In the provided StackBlitz you can see ngcc fails. In my project however I got no errors whatsoever, the share buttons simply did not show up. Changing to 8.0.4 or disabling Ivy rendrer fixed this, so there's definitely an issue with 8.0.5 and Ivy. I haven't really looked into what that may be though.

@ewwwgiddings
Copy link

ewwwgiddings commented Jan 26, 2021

@Laurent02 is right. At least with Angular 10.1.1 there is an issue with version 8.0.5 that causes an error when compiling.

I received this error that disappeared when I downgraded to 8.0.4

ERROR in node_modules/ngx-sharebuttons/icons/share-icons.module.d.ts:2: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 (ngx-sharebuttons/icons) which declares ShareIconsModule 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.

2 export declare class ShareIconsModule {`

@RaimonxDev
Copy link

I have the same error . I tried to add it in angular.json but it generates the following error.

With version 8.0.4 compile. but i can't add the styles. I have the version of angular 11.1

image

@ltoshev
Copy link

ltoshev commented Mar 4, 2021

I am trying to get this going with angular 9 and it does not work.

I get this error:

Invalid constructor parameter decorator in C:/proj/123imot.bg/client/imotbg/node_modules/ngx-sharebuttons/fesm2015/ngx-sharebuttons-icons.js:
() => [
{ type: FaIconLibrary }
]
Error: Error on worker #1: Error: getInternalNameOfClass() called on a non-ES5 class: expected ShareIconsModule to have an inner class declaration
at Esm5ReflectionHost.getInternalNameOfClass (C:\proj\123imot.bg\client\imotbg\node_modules@angular\compiler-cli\ngcc\src\host\esm5_host.js:88:23)

@buu700
Copy link

buu700 commented Apr 18, 2021

@MurhafSousli Based on @ewwwgiddings's error log, could disabling declarationMap potentially fix the issue? (I'm not sure why it would, but there's very little else in the delta between 8.0.4 and 8.0.5 that looks relevant.)

@syahirudean
Copy link

Hi, any chance that there's a solution to this? Will this affect production?

@MurhafSousli
Copy link
Owner

I am sorry I forgot about this issue completely! it is now fixed in v8.1.0

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

No branches or pull requests

8 participants