#2732·stylus

Environment dependent "Maximum call stack size exceeded" error

Author: TokugawaTakeshiCreated Oct 24, 2022Updated May 5, 2026
Labelst: Bug

Recently, I have open the issue "Maximum call stack size exceeded" error on calling the Stylus mixin from the library while without Vite working fine in the Vite repostiory. In my reproduction , I have made the experiment with plain Stylus and it works, and the expetiment with the Vite and it emits the error. I was completely sure that the Vite was the cause, however, the Vite maintainer has created the another reproduction, with Stylus only.

As result: same code could work or not work under uncertain combination of circumstances, however, we have both working and not working reproductions.

To reproduce:

Check this repros:

Current behavior:

Emits "Maximum call stack size exceeded" error in some enviroments.

Expected behavior:

Works correctly in all envirinments.

Environment information:

  • stylus version: 0.59.0
  • nodejs version: v16.13.0

Additional information:

The Paddings mixin calls the validateObjectTypeParameter function. It calls the internal validateSpecificDepthLevelOfTargetObjectTypeParameter function recursively (for the validation of nested objects), and normally, it works fine .

Please feel free to ask me anything about Paddings, validateObjectTypeParameter and other functionality of @yamato-daiwa/frontend.