question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

icon with mask may cause memory leak on ssr [nodejs]

See original GitHub issue
import React from 'react'
import FontAwesomeIcon from '@fortawesome/react-fontawesome'
const Test = () => (
  <div>
    <FontAwesomeIcon icon="star" mask="circle" />
  </div>
)
export default Test

when i add fontawesome icon with mask props, variable name “_uniqueId” in file (@fortawesome/fontawesome/index.js) keep increasing on server side everytime the component was rendered through ReactDOM.renderToString(appComponent)

@fortawesome/fontawesome/index.js 1520654950802

what i got from server rendered <svg aria-hidden="true" data-prefix="fas" data-icon="star" class="svg-inline--fa fa-star fa-w-16 " role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><defs><clipPath id="clip-12"><path fill="currentColor" d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z"></path></clipPath><mask x="0" y="0" width="100%" height="100%" id="mask-11" maskUnits="userSpaceOnUse" maskContentUnits="userSpaceOnUse"><rect x="0" y="0" width="100%" height="100%" fill="white"></rect><g transform="translate(256 256)"><g transform="translate(0, 0) scale(1, 1) rotate(0 0 0)"><path fill="black" d="M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z" transform="translate(-288 -256)"></path></g></g></mask></defs><rect fill="currentColor" clip-path="url(#clip-12)" mask="url(#mask-11)" x="0" y="0" width="100%" height="100%"></rect></svg>

clipPath id keep increasing First <clipPath id="clip-1">

Second <clipPath id="clip-2">

Third <clipPath id="clip-3">Eighth 1520656124326Twentieth 1520656963194

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:2
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
justlevinecommented, Aug 15, 2021

Any progress on this?

1reaction
imarjanoviccommented, Aug 29, 2018

Hey Rob! Just wondering if you folks have made any progress here or if you have any sort of timelines for when a fix for this will be available.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Memory Leak in server.js | React / Express / SSR
Everytime I reloaded the page, the memory usage increased a bit. At the beginning the process takes about ~60MB memory.
Read more >
Understanding memory leaks in Node.js apps - LogRocket Blog
In this article, we are going to learn what memory leaks are, what causes them, and their implications in a Node.js application.
Read more >
Hunting memory leaks in a server side rendered React ...
Our memory leak was caused by reselect and with the bad usage of styled-components, both problems were found by using Chrome DevTools. Backstory....
Read more >
javascript heap memory using webpack serve - You.com
Do not use Vue CLI/Webpack dev mode to debug memory leaks. Webpack's hot module reloading (HMR) can affect what is kept in memory....
Read more >
Firebase JavaScript SDK Release Notes - Google
Replaced idb dependency with in-house code to fix errors that occur when Node.js or SSR apps target ESM. This includes apps using Angular...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found