nitrojs / nitrojs/nitro

[vite] Very high memory usage when building tanstack start

Open
#3,591 14 comments 10 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs reproduction tanstack v3 vite plugin
Dominant language
TypeScript
Stars
11.2k
Forks
899
Avg merge
2d 24m
Merged PRs (30d)
40

Description

Environment
  • Vite nitro (nightly) 3.0.0-20250925 to be precise
    Vite config:
const config = defineConfig({
  plugins: [
    // this is the plugin that enables path aliases
    viteTsConfigPaths({
      projects: ["./tsconfig.json"],
    }),
    tailwindcss(),
    tanstackStart(),
    nitro({
      config: {
        preset: "bun",
      },
    }),
    viteReact(),
  ],
});
Reproduction

I've tried reproducing the issue using the create-start-app with almost all addons to make the app bigger :
https://github.com/xKesvaL/nitro-v3-high-memory

I do have a slightly bigger repo to test this on (see below), but it's private. Any maintainer is welcome to message me and I will happily give it to them.

Describe the bug

I am finding integrating the nitro v3 vite plugin with the new tanstack start RC is yielding way higher memory usage.

Image Image

The two graphs are memory usage on my VPS while building latest start (132.7) + nitro v3 vite plugin (first) VS building beta start, the second one. As mentioned before, this is the private repo.

The build on the left did not manage to finish, as it ran out of memory.

I don't know where this comes from, but will be happy to help if I can

Here's the public repo I made with create-start-app, i've highlighted in red the moment nitro kicks in and memory usage ramps up crazily in 3-5 seconds. In green is vite. It's not as bad as on my VPS, but also not as big of a project.

Image
Additional context

No response

Logs

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by cloning the linked nitro-v3-high-memory reproduction and running its build with the shown Vite plugin configuration; compare memory usage around Nitro activation against the baseline build. Done means the reproduction build completes without the reported runaway memory growth, with the cause and verification documented for the affected integration.

Written by the indexing model from the issue text.

Assessment

Tech stack
bun, tailwindcss, typescript, vite
Domain
build-system, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.