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

Cannot read property 'nativeElement' of undefined when using with Ivy #67

Open
sebastiangug opened this issue Sep 12, 2019 · 7 comments

Comments

@sebastiangug
Copy link

I've looked around here about ivy-related issues but I haven't found much.

Is there any desire to make this library compatible with Ivy?

@bcolin
Copy link

bcolin commented Dec 23, 2019

I would also love to keep using this library with Ivy!

@ErikHDev
Copy link

ErikHDev commented Feb 7, 2020

Just upgraded to Angular 9 and I get the same error. I turned off Ivy and I was still getting the error, so I'm not sure if it's an Ivy issue or not...

@ramtinsoltani
Copy link

Same with me, just upgraded to Angular 9 and got this error:

TypeError: Cannot read property 'nativeElement' of undefined
    at LottieAnimationViewComponent.push../node_modules/ng-lottie/__ivy_ngcc__/dist/esm/src/lottieAnimationView.component.js.LottieAnimationViewComponent.ngOnInit

@Jrbebel
Copy link

Jrbebel commented Feb 25, 2020

Hello
I had the same problem with angular 9, we must replace ngOnInit by ngAfterViewInit to solve the problem

https://github.com/Jrbebel/ng-lottie/blob/master/src/lottieAnimationView.component.ts

@ErikHDev
Copy link

I think this project is on life support, it hasn't had a commit in almost year and a half, and the issues are piling up. Thanks @Jrbebel , I'll have to fork the project and try it myself.

@MarcARoberge
Copy link

@ErikHDev any news ?

@ramtinsoltani
Copy link

ramtinsoltani commented Feb 27, 2020

@ErikHDev I would suggest taking a look at ngx-lottie before you attempt fork to this project.

ngx-lottie seems maintained and works with ivy, and most importantly, it's highly compatible with this project, API-wise.

It literally took me only a few minutes to switch since almost all events and APIs had equivalents either in the same name (so no change is required) or with a similar one (event animCreated is animationCreated in ngx-lottie).

Also, ngx-lottie has better TypeScript typings as opposed to this project where the emitted event data is any.

I hope this helps someone.

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

6 participants