AckerApple / ack-angular-fx

Angular animations made easier
MIT License
34 stars 3 forks source link

Type error when ng build (on Angular 5.2.11 and fx 3.0.2) #6

Closed rmcsharry closed 5 years ago

rmcsharry commented 5 years ago

Thanks for this great library that works so well and is so easy to add animations quickly to my project! Totally loving it and using it in 2 separate projects now.

I have no issues in local dev but when I deploy and run ng build, I get a "must declare type" error on this line:

export declare const animations: import("@angular/animations").AnimationTriggerMetadata[];

If I revert to version 2.3.1 then there is no build error.

AckerApple commented 5 years ago

Thank you very much for the kind words.

I don’t understand the full context of your issue and the sample code you have pasted. Using this package is incredibly simple so I’m not sure where you are having issues.

This package is used in production. It works solid. I’m assuming your using incorrectly.

Give me more details

rmcsharry commented 5 years ago

@AckerApple Hi and thanks for the incredibly quick response, esp on a Sunday!

I first used this on an Angular 6 project a few weeks ago, no problems.

I cannot yet upgrade my Angular 5.2.11 project due to other dependencies. But I notice your readme says it supports 5.2+ so I followed the instructions and added your library to this 5.2 project also. I implemented a basic stagger animation, which works perfectly (thanks thats a great feature btw!).

However when I try to create the production build, I run ng build and it throws this error:

ERROR in node_modules/ack-angular-fx/dist/allFx.d.ts(5,34): error TS1110: Type expected.

As you can see that is referencing a file in your project, so I think there must be a dependency on Angular 6 here is my guess?

EDIT - apologies I posted the above from my mobile and I just noticed I pasted only one bloody line in my first post! The actual error is in this post as you can now see and the line that throws it is the one in my original post.

AckerApple commented 5 years ago

That’s most certainly a TypeScript error. But it’s most likely related to older versions of Angular that demand older versions of TypeScript.

I first recommend you see how far Angular will allow you to update your TypeScript. It won’t be the latest version of TypeScript because even latest version of Angular still wants older versions of TypeScript.

I just about cried and gave up on Angular during version 2-4. But 5-7 have made me a proud Angular developer.

At this point I’m left to assume you are just going through upgrade pains and it would help you with this package to be as up to date as possible.

rmcsharry commented 5 years ago

Not upgrading just yet (but that is soon on the todo list). I saw your painful comments on the library that inspired this one (and I agree Angular is now awesome and I am now hating that I just got thrown a huge react project at work!).

Anyway my main reason to post the issue was that your readme does claim support for 5.2+ which is the version I am on, and I am also using typescript 2.4, which is within the recommended range as you can see here.

I will install Typescript 2.6.2 and see if the error goes away.

rmcsharry commented 5 years ago

Typescript 2.6.2 gives a different error:

ERROR in node_modules/ack-angular-fx/dist/allFx.d.ts(5,40): error TS1005: '=' expected.

Trying 2.7.2 gives another error:

ERROR in node_modules/ack-angular-fx/dist/allFx.d.ts(5,40): error TS1005: ',' expected.

Maybe your library is not compatible with Angular 5.2+? But only 6+?

rmcsharry commented 5 years ago

For now I will downgrade to v2.3.1 of your (awesome) library since that builds and runs fine with Angular 5.2. (including the stagger animation I need).

So thanks for all your efforts. I will upgrade to Angular 6 or 7 next month anyway and v2.3.1 is perfectly functional until then.

AckerApple commented 5 years ago

Heads up, when you update to latest version of this package you may have to watch out that I switch fadeInUp for fadeInOutUp and now fadeInUp only animates the in but not that out.

Just a heads up if you on that old of a version and that the In for InOut applies to most all animations

Thanks for all the details and comments. I’m most certain your type issues are from being on less than TypeScript 3