[ssr] window is not defined. Problem with vue-perfect-scroll


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

krim pro asked 6 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.


Mikołaj Smoleński staff answered 6 years ago

Thanks for Your remarks!

Best Regards


krim pro answered 6 years ago

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


Mikołaj Smoleński staff commented 6 years ago

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

We apologize for the delay.

Best regards


paddek answered 6 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


Magdalena Dembna staff premium answered 6 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


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
Tags