0

I'm trying to get Lottie/Bodymovin' integrated into an Ionic 4 app and I'm having no luck.

Currently I'm running:

  • "@ionic/angular": "4.1.0"
  • "@angular/core": "~7.1.4"
  • "ng-lottie": "0.3.1"

The error I'm getting is:

ERROR DOMException: Failed to read the 'responseText' property from 'XMLHttpRequest': The value is only accessible if the object's 'responseType' is '' or 'text' (was 'json').

I've also tried libraries such as:

I still get the same error.

The implementation is very straightforward, so it isn't an implementation issue.

The only other option I can really think of is importing bodymovin directly with a typings file, but I've never tried that.

I'm open to any suggestions I might not have thought of.

rtpHarry
  • 13,019
  • 4
  • 43
  • 64
  • Have you seen this plugin which uses lottie for [animated splashscreens](https://ionicframework.com/docs/native/lottie-splash-screen) - I haven't used it yet but it could be a starting point for your problem. – rtpHarry Jun 19 '19 at 10:25
  • @rtpHarry i did try that and i get `ERROR in src/app/pages/update-item/update-item.page.ts(56,6): error TS2339: Property 'then' does not exist on type 'void'.` or `NullInjectorError: No provider for LottieSplashScreen!` it seems like lottie won't work in ionic 4 – Michael Christopher Martire Jun 19 '19 at 16:04

1 Answers1

0

The reason i got this was because i was using a faulty json file i downloaded from lottiefiles. Once i swapped it for a new one, it worked.