Skip to content
ChartDeck ChartScript docs Account Open the terminal

CS1041

error Expressions or blocks are nested too deeply (more than max levels).

#What it means

Expressions or blocks are nested more deeply than the compiler allows (the message gives the limit, 200 levels).

#Typical cause

  • Generated code with hundreds of nested parentheses or ternaries.
  • Blocks nested inside blocks hundreds of levels deep.

#How to fix it

Break the expression into named steps, or move inner parts into functions.

#Example

It needs more than 200 levels of nesting, which cannot be shown in a readable example.

  • CS1040 — The script is too large: a script can hold up to max KB of code.

The ChartScript documentation is in English for now; translations will follow.