Topic: [ssr] window is not defined. Problem with vue-perfect-scrollbar

krim pro asked 4 years ago


There is the problem with "vue-perfect-scrollbar". Please replace it with https://www.npmjs.com/package/vue2-perfect-scrollbar

It's very easy to replace it. The second package just the same, but with SSR support.


Magdalena Dembna staff answered 3 years ago


Hi, We've updated Perfect Scrollbar in the latest MDB Vue version 5.3.0. and I hope this problem will not occur anymore. Please let us know if you're still experiencing any difficulties. Kind regards, Magdalena


paddek free answered 3 years ago


I stumbled across the same problem during evaluation of MDB Vue for our nuxt project. For me a quick and dirty solution is this snipped...

require('require-extension-hooks')('js').push(({filename, content}) => {
    if (filename.endsWith('/node_modules/vue-perfect-scrollbar/dist/index.js')) {
        return ['!process.client && require("browser-env")()', content].join('\n');
    }
});

placed in the nuxt app entry /server/index.js


krim pro answered 3 years ago


@Mikołaj Smoleński Have you got any news to fix it?


Mikołaj Smoleński staff commented 3 years ago

It will surely be released with the next version of MDB Vue.

We apologize for the delay.

Best regards


Mikołaj Smoleński staff answered 4 years ago


Thanks for Your remarks!

Best Regards



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • User: Pro
  • Premium support: No
  • Technology: MDB Vue
  • MDB Version: 4.8.2
  • Device: all
  • Browser: all
  • OS: all
  • Provided sample code: No
  • Provided link: No