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.

Offline usage in Nuxt 2 slows down the dev page loading times

See original GitHub issue

nuxt: 2.15.8 node: v16.14.2

I’m working on it with Nuxt SSR. I created a plugin

//plugins/iconify.js
import Vue from 'vue';
import { Icon } from "@iconify/vue2";
import { addIcon } from "@iconify/vue2/offline";

import mdiYoutubeTv from "@iconify/icons-mdi/youtube-tv";
addIcon('mdi:youtube-tv', mdiYoutubeTv);

Vue.component('Icon', Icon);

run yarn dev

After that it seems The loading of the web page is extremely slow. It takes about 1-3+ seconds from 50-200ms. If importing a lot It will take more time. This only happens when dev only production is very fast.

before image

after image

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
cyberaliencommented, Oct 14, 2022

If you want to use only offline mode, maybe unplugin-icons would solve issue? See https://github.com/antfu/unplugin-icons

It generates components dynamically for each icon, no extra overhead. Iconify components are meant to be used with API, but unplugin-icons is meant to be used with bundlers.

0reactions
cyberaliencommented, Oct 14, 2022

Excellent.

unplugin-icons is a much better solution for offline use.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nuxt 2 SSR dev response very slow - vue.js - Stack Overflow
I use SSR and WSL2 and i think it is not from WSL2 and Docker because its api is very fast. page response...
Read more >
Vue and Nuxt Performance Optimization Checklist
Read the comprehensive and in-depth technical article summarizing how to improve the site performance with efficient use of Vue.js and Nuxt.
Read more >
doesn't stop loading and none of the nuxt-links are working ...
The nuxt-links should load when clicked. What is actually happening? Pages NEVER finish loading...even if npm run dev is restarted. This happens ...
Read more >
Loading - Nuxt
Loading. Out of the box, Nuxt gives you its own loading progress bar component that's shown between routes. You can customize it, disable...
Read more >
The Ultimate Guide to Optimize Vuejs App Performance
The reasons for slowing down the Vue performance depend upon your ... It is not worth loading the entire bundle every time the...
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