N
Nuxt3w ago
Jay

Nuxt 2 long delay before application is loaded

Hi, currently building a bigger Nuxt 2 SSR app. When I load the page up on staging, there is a big delay between the two chunks highlighted. The second one highlighted is only started at 8 seconds, which is waaaay to long. What could the reasons for this be and how can I debug and find out why this is taking so long to load?
No description
3 Replies
kapa.ai
kapa.ai3w ago
Hi @Jay. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- A long delay before your Nuxt 2 SSR application loads can be caused by several factors. Based on the knowledge sources, here are common reasons and debugging strategies: Common Causes - Overusing plugins: Too many or inefficient plugins can block rendering during hydration, causing delays. Review your plugins and consider refactoring some into composables or utility functions if possible. - Unused code/dependencies: Extra, unused code or dependencies increase bundle size and slow down loading. Audit your package.json and codebase for unused items. - Not using Vue performance tips: Techniques like shallowRef, v-memo, and v-once can improve performance but are often overlooked in Nuxt projects. - Not following patterns: Inconsistent coding patterns can introduce inefficiencies. Establish and follow best practices for maintainability and performance. - Trying to load everything at once: Fetching all data and resources simultaneously can overwhelm the browser and network. Use progressive enhancement and lazy loading where possible to prioritize critical content first Common problems. Debugging Strategies - Chrome DevTools: Use the Performance and Lighthouse tabs to analyze loading times, Largest Contentful Paint (LCP), and other Core Web Vitals. These tools help pinpoint which resources or scripts are causing delays Chrome DevTools. - Nuxt DevTools: Offers a timeline for rendering, updating, and initializing components, helping you identify bottlenecks. The Assets and Inspect features show file sizes and evaluation times, which can reveal large or slow-loading assets Nuxt DevTools. - Profiling Tools: Tools like Nuxi Analyze, PageSpeed Insights, and WebPageTest can provide further insights into what is slowing down your app docs: add performance best practices section. Next Steps 1. Profile your app using Chrome DevTools and Nuxt DevTools to identify which resources or scripts are causing the delay. 2. Audit your plugins and dependencies for unnecessary or inefficient code. 3. Apply Vue and Nuxt performance best practices, such as lazy loading and progressive enhancement. 4. Consider splitting your code and assets to avoid loading everything at once. If you need more specific guidance, try to capture a performance profile and look for large gaps or slow scripts in the timeline. This will help you pinpoint the exact cause of the delay. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3w ago
<@103820307080437760> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
Jay
JayOP3w ago
Could any one tell me if this big delay gap between the chunks is actually related to nuxt or if it could be something else? I made the chunk size much smaller to test things and the delay is pretty much the same.

Did you find this page helpful?