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.

Huge js file generated when used with nuxt3 in ssr mode

See original GitHub issue

Describe the bug An unminified inlinded css as a js template string is added to built files when using vue-fontawesome with nuxt3.

Reproducible test case https://codesandbox.io/s/compassionate-leavitt-3ehro?file=/plugins/fontawesome.ts Here is a repro of this issue. Simple open the preview window in a new window then check the js files generated in the dev console (in sources/debugger tab). This has been a major hurdle in me getting a decent lighthouse score.

Expected behavior With config.autoAddCss = false no css should exist in the build files.

Desktop (please complete the following information):

Additional context I have followed the instructions for nuxt, but that doesnt seem to fix it. Additionally, webpack 5 is being used as the bundler in nuxt3.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
Blakeinsteincommented, Feb 8, 2022

How did you use it with nuxt3? Is the .component() method available in the nuxtApp.vueApp?

Well in the reproduction, I created a plugin that registers the fontawesome component as Fa

0reactions
P4sca1commented, Nov 3, 2022

Importing each icon individually should resolve the issue.

import { faUser } from '@fortawesome/free-solid-svg-icons/faUser'

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to set a nuxt3 project in ssr mode? - Stack Overflow
And in the nuxt.config.ts I have set the target: 'server'; but there is still a problem that the project is not running in...
Read more >
Creating Server-side Rendered Vue.js Apps Using Nuxt.js
First, it's best to test your application without the SSR as by default npm run dev runs with SSR on. To change that,...
Read more >
Rendering Modes in Nuxt 3 - This Dot Labs
To deploy and use our Nuxt 3 application on a node-server in universal mode: First in nuxt.config.js file. defineNuxtConfig({ ssr: true ...
Read more >
Hybrid Rendering in Nuxt.js 3 - Vue School Blog
Nuxt 3 gives you plenty of options when it comes to rendering. ... the big advantages of using Nuxt over a regular client...
Read more >
Nuxt 3 Beta: What's New and How to Get Started - SitePoint
For example, a tasks.js file will generate an ... This allows for using a hybrid mode for static plus serverless sites.
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