You only get this error if running in developer mode
Using "run map after compile" auto loads "in" devmode
To find and properly fix this error - you would need to
Developer 1
Logfile 2
/devmap map name
And check the logfile txt it creates in your mod folder in root/mods/yourmod
Or, open the console and type
Developer 0
Before starting your map - to ensure devmode is off