Issue with animation.d.ts


#1

Hey guys,

I’m trying to spin a ionic typescript v2 project. I’ve tried with both default and “tutorial” templates but there’s seems to be a problem with the type definition animation.d.ts. I get these error after executing ionic serve:

ERROR in [default] /Users/alejandromcsd/Dropbox/Proyectos/maltayqueso/ionic/myq/node_modules/ionic-framework/animations/animation.d.ts:48:50 
A 'this' type is available only in a non-static member of a class or interface.

ERROR in [default] /Users/alejandromcsd/Dropbox/Proyectos/maltayqueso/ionic/myq/node_modules/ionic-framework/animations/animation.d.ts:54:50 
A 'this' type is available only in a non-static member of a class or interface.

These are the commands I’m using to spin a v2 app:

ionic start myq --v2 --ts
ionic start myq tutorial --v2 --ts

Any workarounds? I read something about replacing “this” for “Animation” in the type definition file but that’s causing other compilation exceptions.


#2

Replacing ‘this’ with ‘Animation’ in lines 48 and 54 in animation.d.ts solved the problem perfectly for me, thanks! I just tried the first ionic start command you have above and modified those two lines now. It compiled totally clean and removed those two warnings above. I’m sure these warnings will disappear soon anyway.


#3

Replacing ‘this’ with ‘Animation’ also works for me.


Ionic 2 serve error - app.ts - Cannot find name 'Type'
#4

Done, working fine now.

For some reason, it doesn’t work if you do a ionic serve, then replace ‘this’ with ‘Animation’ in lines 48 and 54, and then ionic serve again. Maybe I’m missing some “clean / rebuild command”?

I had to delete my app, provisioned again with ionic start and replaced lines before doing a first ionic serve cmd.

Thanks guys


#5

worked for me without refresh. I stopped the server and restart it after the modification. Hope it helps