compiler limit: out of local keys compiling function 'function'
Too many local variables prevent compiling the function. Divide the function into smaller functions.