Skip to content

Fix stack overflow when loading jiti-based configs in monorepos#446

Closed
Boshen wants to merge 1 commit intomainfrom
fix-jiti-stack-overflow
Closed

Fix stack overflow when loading jiti-based configs in monorepos#446
Boshen wants to merge 1 commit intomainfrom
fix-jiti-stack-overflow

Conversation

@Boshen
Copy link
Copy Markdown
Collaborator

@Boshen Boshen commented Feb 5, 2026

Summary

  • Fixes the "Maximum call stack size exceeded" error that occurs when using unbuild's --stub mode for shared Tailwind CSS config packages in monorepos
  • When auto-detecting Tailwind CSS config files, catches RangeError (stack overflow) that can occur with jiti-based configs
  • When this error occurs on auto-detected configs (not explicitly specified), falls back to bundled v4 instead of crashing
  • Explicit configs still error to respect user intent

Fixes #431

🤖 Generated with Claude Code

When auto-detecting Tailwind CSS config files, catch RangeError (stack
overflow) that can occur with jiti-based configs like unbuild stubs.
This commonly happens in monorepos where a shared tailwind config
package uses unbuild's --stub mode, causing nested jiti Proxy handlers
to recursively call each other.

When this error occurs on auto-detected configs (not explicitly
specified), fall back to bundled v4 instead of crashing. Explicit
configs still error to respect user intent.

Fixes #431

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Boshen
Copy link
Copy Markdown
Collaborator Author

Boshen commented Feb 5, 2026

@Dunqing can you help review

@Dunqing
Copy link
Copy Markdown
Contributor

Dunqing commented Feb 5, 2026

It doesn't seem to be going quite well; it can't fall back to v4 because it has already determined this is a v3 Tailwind CSS project.

@Boshen Boshen closed this Feb 5, 2026
@Boshen Boshen deleted the fix-jiti-stack-overflow branch February 5, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Maximum call stack size exceeded

2 participants