FortAwesome / react-fontawesome

Font Awesome React component
https://fontawesome.com
MIT License
3.67k stars 262 forks source link

Error legacy browers es5 #541

Open danielrosendos opened 1 year ago

danielrosendos commented 1 year ago

Describe the bug When trying to run the compiled library in a lesser supported browser like firefox 47 I have a problem of _hooks[hook].push(_hooks[hook]) is not a function. When we look deeper where it finds the error, it finds the error in the watch part. In the newest chrome this watch comes as an array and renders normally. As we came to the conclusion that the error is due to the library, because removing it the page renders normally in this old browser.

Reproducible test case We are using vite as the compilation tool. So just run a yarn run build and after that run a yarn run preview and so when testing in an older browser the page will not render, giving an error in the function mentioned above.

image

Expected behavior From expectations I wanted help on how to resolve this error, if anyone has already experienced it, if it is just to adjust something in the vite compilation configuration, I already find myself out of ideas.

Desktop (please complete the following information):