#Each page load has 1,000+ requests and transfers 20mb of data in Dev Mode

8 messages · Page 1 of 1 (latest)

waxen tangle
#

I have no idea what I've done. But each page load has around 1,000 requests and transfers 20mb of data, this is a simple HTML page.

I've got anohter local project and it's doing the same thing, although the other project transfers around 40mb of data.

Nuxt 4, Nuxt Content, Installed with Node 22, manOS 13.

Building and then previewing it works perfectly fine.

But the dev mode is crushing my poor old laptop 😂

lunar egretBOT
#

Hi @waxen tangle. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

This sounds frustrating! Based on the knowledge sources available, I can offer some relevant context, though they don't contain a definitive root cause for your specific situation.

What the Knowledge Sources Say

The high data transfer in dev mode is a known characteristic of Nuxt's development server. One GitHub issue notes a similar observation:

"In production or development? I only faced this issue in dev - every request adds some memory and not releasing. In production - everything stable." [SSR memory leak issue]

This aligns with your experience — you mentioned that building and previewing works fine, which suggests this is a dev-mode-specific behavior rather than a bug in your application code.

Likely Contributing Factors

  1. Dev server overhead: The Vite dev server in development mode serves many unbundled modules individually (HMR, source maps, etc.), which dramatically inflates request counts and transfer sizes compared to a production build.

  2. Large payloads (__NUXT__ object): If you're fetching data (especially with Nuxt Content), the full API response can be inlined into the HTML as the __NUXT__ payload object. In dev mode, this is uncompressed and unoptimized. [Nuxt Performance in Depth]

  3. Overusing plugins: A large number of plugins can cause performance issues in dev, especially during the hydration phase. [Nuxt performance best practices]

Suggestions

#
  • Use Nuxt DevTools to inspect what's contributing to the load — it can show file sizes, render trees, and evaluation times. [Nuxt DevTools]
  • Use the transform option in useFetch/useAsyncData to reduce payload size if you're fetching large datasets from Nuxt Content or external APIs. [Nuxt Performance in Depth]
  • Check for unused dependencies/plugins in your project. [Nuxt performance best practices]

Since the production build works fine, this is most likely expected dev-mode behavior (unbundled modules, no compression, HMR overhead), but the knowledge sources don't contain enough detail to pinpoint the exact cause of 1,000+ requests specifically. I'd recommend opening a minimal reproduction on the Nuxt GitHub if the DevTools inspection doesn't reveal an obvious culprit.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@waxen tangle Kapa.ai is still learning and improving, please let me know how I did by reacting below.

waxen tangle
#

@lunar egret could this be related to Nuxt Contnet withbetter-sqlite3 ?

lunar egretBOT
#

Let me check the knowledge base for you again. One moment! :books:

#

The knowledge sources don't contain enough information to directly link better-sqlite3 to the 1,000+ requests / 20MB dev mode issue you're experiencing.

What the knowledge sources do mention about better-sqlite3 is limited to its compatibility characteristics in Nuxt Content:

better-sqlite3: Works in all Node environments, GitHub CI, Vercel CI and production, Cloudflare CI pipelines, etc. (Does not work in WebContainers and StackBlitz) [Nuxt Content configuration]

There's no mention in the knowledge sources of better-sqlite3 causing excessive requests or large data transfers in dev mode.

What is documented is that Nuxt Content v3 uses SQLite and, for client-side navigation, downloads a generated database dump from the server to initialize a local SQLite database in the browser on the first content query. [Nuxt Content database] This dump download could contribute to large data transfers, but the knowledge sources don't confirm it would cause 1,000+ requests.

If you suspect Nuxt Content is the culprit, you could test by temporarily removing it from your project to see if the request count and transfer size drop significantly. That would help isolate whether it's Content-related or a broader dev server issue.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: