MMF-FE / svgicon

SVG icon components and tool set
https://mmf-fe.github.io/svgicon
MIT License
922 stars 95 forks source link

Memory leak if icon is not registered (SSR) #71

Closed stas-sl closed 4 years ago

stas-sl commented 5 years ago
// if no iconData, push to notLoadedIcons
notLoadedIcons.push({name: this.iconName, component: this})

Hi!

Today I spend quite a few hours finding memory leak in our application. As it turned out we had an icon in one of our pages which wasn't registered (our bad), but this caused notLoadedIcons list to grow on each request (SSR), keeping references to icon components forever in the server process.

Not sure I completely understand the idea behind notLoadedIcons list, but maybe it should be revised to at least warn if icon was not registered or maybe this list doesn't make sense on server side at all.

Alex--C commented 5 years ago

Spent the last two days on the same issue - be careful when you use this with nuxt!

Allenice commented 5 years ago

Please try the next major version which is fix this issue. https://github.com/MMF-FE/vue-svgicon/tree/dev