vue-snotify icon indicating copy to clipboard operation
vue-snotify copied to clipboard

Possible memory leak on SSR / server side

Open arenddeboer opened this issue 6 years ago • 1 comments

First off, thanks for this super awesome plugin!

That being said, I think I just discovered a memory leak when using snotify with SSR. This can be mitigated by only installing the plugin on the client side (which probably makes sense anyway). I haven't found the root cause of this leak, but by not installing (Vue.use()) this plugin server-side solved the leak. For anyone wondering how to do this: make sure you know if you are rendering client or server side eg. in webpack.client.config:

plugins: [
    new webpack.DefinePlugin({
      'process.BROWSER_BUILD': true,
    })
]

Next only use the plugin if this variable is true

if (process.BROWSER_BUILD) {
  Vue.use(Snotify)
}

arenddeboer avatar Jun 08 '18 15:06 arenddeboer

I think that needs to be added to the readme.

Oleg-Arkhipov avatar Oct 28 '19 10:10 Oleg-Arkhipov