MurhafSousli / ngx-scrollbar

Custom overlay-scrollbars with native scrolling mechanism
https://ngx-scrollbar.netlify.app/
MIT License
611 stars 99 forks source link

analogjs ssr with ng-scrollbar #588

Closed leblancmeneses closed 4 days ago

leblancmeneses commented 5 months ago

Reproduction

Steps to reproduce:

  1. install analogjs with ssr enabled
  2. use ng-scrollbar on (index).page.ts

Expected Behavior

What behavior were you expecting to see?

SSR to work with ng-scrollbar

Actual Behavior

What behavior did you actually see?

ERROR TypeError: Cannot read properties of null (reading 'firstCreatePass')
    at providersResolver (file:///Users/leblancmeneses/organizations/rh/labs/node_modules/@angular/core/fesm2022/core.mjs:26718:15)
    at definition.providersResolver (file:///Users/leblancmeneses/organizations/rh/labs/node_modules/@angular/core/fesm2022/core.mjs:26979:24)
    at initializeDirectives (/Users/leblancmeneses/organizations/rh/labs/node_modules/@angular/core/fesm2022/core.mjs:11111:17)
    at resolveDirectives (/Users/leblancmeneses/organizations/rh/labs/node_modules/@angular/core/fesm2022/core.mjs:11085:13)
    at elementStartFirstCreatePass (/Users/leblancmeneses/organizations/rh/labs/node_modules/@angular/core/fesm2022/core.mjs:22249:5)
    at Module.ɵɵelementStart (/Users/leblancmeneses/organizations/rh/labs/node_modules/@angular/core/fesm2022/core.mjs:22285:9)
    at TrendingComponent_Template (/Users/leblancmeneses/organizations/rh/labs/apps/startupwiki/src/app/components/trending/trending.component.ts:32:35)
    at executeTemplate (/Users/leblancmeneses/organizations/rh/labs/node_modules/@angular/core/fesm2022/core.mjs:10573:9)
    at renderView (/Users/leblancmeneses/organizations/rh/labs/node_modules/@angular/core/fesm2022/core.mjs:11775:13)
    at renderComponent (/Users/leblancmeneses/organizations/rh/labs/node_modules/@angular/core/fesm2022/core.mjs:11721:5)

Environment

"@analogjs/platform": "1.1.2",

Workaround:

    ssr: {
      noExternal: [
         ....
        'ngx-scrollbar/**',
      ],
    },
MurhafSousli commented 4 months ago

I am not familiar with analogjs, Could you add a reproduction link?