Skip to content

getCSSRecursively call stack size exceeded when using manualChunks #5150

Closed

Description

@kevinehosford

Which project does this relate to?

Start

Describe the bug

i have run into this when trying different manualChunks configurations. i was able to reproduce it in the repo below. the example is not really my intended configuration but just shows how it can happen.

this example also intentionally has a circular dependency because my other project has them: https://github.com/kevinehosford/start-basic-overflow/blob/main/src/routes/posts.tsx#L4-L5.

i'm wondering, is it a bug that this recursive function causes a stack overflow?

Image

Your Example Website or App

https://github.com/kevinehosford/start-basic-overflow

Steps to Reproduce the Bug or Issue

  1. set up a tanstack start project with manualChunks and a circular dependency in the application code
  2. npm run build
    -> see getCSSRecursively lead to a call stack overflow exception during the SSR build

Expected behavior

no stack overflow exception like with the client bundle build

Screenshots or Videos

No response

Platform

  • Router / Start Version: 1.131.31
  • OS: macOS
  • Bundler: vite
  • Bundler Version: 6.3.5

Additional context

No response

Activity

  1. changed the title [-]`getCSSRecursively ` call stack size exceeded specifying `manualChunks`[/-] [+]`getCSSRecursively ` call stack size exceeded when using `manualChunks`[/+] on Sep 16, 2025
  2. ImLunaHey commented on Oct 10, 2025

    @ImLunaHey

    from testing changing the recursive call to a while loop fixes the issue.

  3. added a commit that references this issue on Oct 23, 2025
    cc0ed53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions