Coder Social home page Coder Social logo

Comments (12)

Ismaestro avatar Ismaestro commented on June 17, 2024 1

Fixed with this:

  isBrowser: boolean;

  constructor(@Inject(PLATFORM_ID) private platformId: Object) {
    if (isPlatformBrowser(this.platformId)) {
      this.isBrowser = true;
    }
  }
  <ng-container *ngIf="isBrowser">
    <ngx-progressive-image-loader
      [filter]="'blur(3px) drop-shadow(0 0 0.75rem crimson)'"
      [placeholderImageSrc]="hero.avatarBlurredUrl">
      <img (click)="seeHeroDetails(hero)" src="{{hero.avatarUrl}}" alt="" ngxProgressiveImage />
    </ngx-progressive-image-loader>
  </ng-container>

Maybe you should add some documentation on this or a demo...
Finally working here :)

from ngx-progressive-image-loader.

Ismaestro avatar Ismaestro commented on June 17, 2024 1

Yup so weird. You can reproduce the error just clone my project, upgrade the version, npm run build:ssr and npm run serve:ssr. You will see the error...

from ngx-progressive-image-loader.

maxisam avatar maxisam commented on June 17, 2024

I thought I had a demo? but thanks! This is still work in process. I will try to make it better and welcome to make a pull request.

from ngx-progressive-image-loader.

maxisam avatar maxisam commented on June 17, 2024

Could you try 4.0.0-beta.9? you don't need <ng-container *ngIf="isBrowser"> anymore in theory.

from ngx-progressive-image-loader.

Ismaestro avatar Ismaestro commented on June 17, 2024

Done, and yes, it's working as expected.

Thanks!!

from ngx-progressive-image-loader.

maxisam avatar maxisam commented on June 17, 2024

Thank you! Btw, I liked your project from long times ago. Thank you for creating that project.

from ngx-progressive-image-loader.

maxisam avatar maxisam commented on June 17, 2024

@Ismaestro also could you try 4.0.0-beta.12. I think it will help on things like some images are not loaded properly

from ngx-progressive-image-loader.

Ismaestro avatar Ismaestro commented on June 17, 2024

With that version while serving the app with ssr, I got this error:

> [email protected] serve:ssr /Users/iramos/WebstormProjects/angular7-example-app
> node dist/server

Node server listening on http://localhost:4000
/Users/iramos/WebstormProjects/angular7-example-app/dist/server.js:344
                        throw error;
                        ^

TypeError: Cannot read property 'src' of undefined
    at loadImage (/Users/iramos/WebstormProjects/angular7-example-app/dist/server.js:279342:27)
    at ProgressiveImageDirective.ngOnInit (/Users/iramos/WebstormProjects/angular7-example-app/dist/server.js:279694:13)
    at checkAndUpdateDirectiveInline (/Users/iramos/WebstormProjects/angular7-example-app/dist/server.js:26202:19)
    at checkAndUpdateNodeInline (/Users/iramos/WebstormProjects/angular7-example-app/dist/server.js:27466:20)
    at checkAndUpdateNode (/Users/iramos/WebstormProjects/angular7-example-app/dist/server.js:27428:16)

Serving the app with JIT goes fine.

:)

from ngx-progressive-image-loader.

maxisam avatar maxisam commented on June 17, 2024

Weird. That doesn't make any sense. There are only 2 changes between 9 and 12, 819dae7 and 717c266 I don't understand how could it work on 9 but not 12

from ngx-progressive-image-loader.

maxisam avatar maxisam commented on June 17, 2024

I will try it sometime this week.

from ngx-progressive-image-loader.

rassrig avatar rassrig commented on June 17, 2024

I've also encountered an error while running with universal app

export '_window' (imported as 'i11') was not found in 'ngx-window-token'

"ngx-progressive-image-loader": "^3.0.2",
"ngx-window-token": "^2.0.1",
"tslib": "^1.10.0

Tried to recreate this with just angular and works fine.
Let me know if I missed something

from ngx-progressive-image-loader.

maxisam avatar maxisam commented on June 17, 2024

please try the latest beta version. 4.0.0-beta.15. I used it on production for a while already.

from ngx-progressive-image-loader.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.