zyra / ionic-image-loader

Ionic 2+ Component that loads images in a background thread and caches them for later use
MIT License
435 stars 137 forks source link

Compile Error #281

Open dodomui opened 4 years ago

dodomui commented 4 years ago
ERROR in ./node_modules/ionic-image-loader/dist/providers/image-loader.js
[ng] Module not found: Error: Can't resolve 'rxjs/observable/fromEvent' in '/Users/../../node_modules/ionic-image-loader/dist/providers'
ERROR in ./node_modules/ionic-image-loader/dist/providers/image-loader.js
[ng] Module not found: Error: Can't resolve 'ionic-angular' in '/Users/../../node_modules/ionic-image-loader/dist/providers'

Received above error, I did try change ionic-angular to @ionic-angular can solve this error. May I know how to solve the rxjs issue?

Here is my enviroment

Ionic:

   Ionic CLI                     : 6.3.0 (/Users/nelsonmui/.nvm/versions/node/v12.16.1/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.0.7
   @angular-devkit/build-angular : 0.803.25
   @angular-devkit/schematics    : 8.3.25
   @angular/cli                  : 8.3.25
   @ionic/angular-toolkit        : 2.2.0

Capacitor:

   Capacitor CLI   : 1.5.2
   @capacitor/core : 1.5.2

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : none
   Cordova Plugins   : no whitelisted plugins (0 plugins total)

Utility:

   cordova-res (update available: 0.11.0) : 0.9.0
   native-run                             : 0.3.0

System:

   ios-deploy : 1.10.0
   NodeJS     : v12.16.1 (/Users/nelsonmui/.nvm/versions/node/v12.16.1/bin/node)
   npm        : 6.14.4
   OS         : macOS Catalina
   Xcode      : Xcode 11.4 Build version 11E146
maxtomczyk commented 4 years ago

Hi! Same problem here. I managed to fix rxjs import problem by changing:

import { fromEvent } from 'rxjs/observable/fromEvent';

to:

import { fromEvent } from 'rxjs';

However, fixing this is temporary, because you are editing code which is built and stored in node_modules. I will try to find some other solution.

maxtomczyk commented 4 years ago

It looks like there is another branch for Ionic 4, but it didn't work for me on Ionic 5. https://github.com/zyra/ionic-image-loader/tree/v4

dodomui commented 4 years ago

@maxtomczyk It is working for me on Ionic 5 + capacitor using this branch. The problem I'm facing now is the image cache not really working on iOS device.