Skip to content

getCSSRecursively call stack size exceeded when using manualChunks #5150

@kevinehosford

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions