CommandBox Lucee shows error: Method Code too Large

172 Views Asked by At

I'm getting an issue in Lucee when my file size is greater than 64KB, it shows an error "Method code too large!". I also attached a screenshot below, please check and help me to resolve this issue.

enter image description here

1

There are 1 best solutions below

0
On

Lucee obviously has a limit regarding the size of methods. The error message already provides all the information you need.

You should split up your code into several files. This can be done by moving out parts into different templates, i.e. CFM files, and then include them in your main CFM via <cfinclude>. Or alternatively, you can move the code into components, i.e. CFC files and instanciate them via createObject() in your main CFM.