Icons load incorrectly (very large) in server side when using library.add (Nuxt.js)
See original GitHub issueIcons render initially very large until finally settling down to wanted size. I’m using nuxt with server side rendering.
Fontawesome gets loaded as a plugin with nuxt.js:
import fontawesome from '@fortawesome/fontawesome'
import iconCSS from './icon-css.css'
import {
faFrown
} from '@fortawesome/fontawesome-free-solid'
fontawesome.dom.styles(iconCSS)
fontawesome.library.add(
faFrown
)
export default fontawesome
Am I missing something here? Is there a workaround for this behavior?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:14
- Comments:9 (3 by maintainers)
Top Results From Across the Web
The Actual Fix To The NuxtJS + UIkit Icons Loading Issue
This video looks at a simple fix to the icon loading issue with NuxtJS and the UIkit front-end framework. NuxtJS by default does...
Read more >Server-side rendering with Vue and Nuxt.js - LogRocket Blog
In this container, we have a special tag app , which will contain content parsed by Vue. The server is now only responsible...
Read more >vue.js - How can I dynamically load svg icons from ...
You can try to make method in components/BaseCryptoIcon.vue:
Read more >How to Configure SSG and SSR on Nuxt.js - Mad Devs
In this case, we will not load frontend with additional code + all the tokens will be on the server side, which is...
Read more >Understand and solve hydration errors in Vue.js - sum.cumo
If a component is initially mounted or hydrated in the DOM, it needs to precisely correspond to the HTML generated on the server...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@chewtoys Here is my example (using the pro version):
font-awesome.js (place in the plugins folder):
nuxt.config.js (relevant part)
index.vue
I had the same problem using Nuxtjs but I fixed just reading the readme