Does this happen with every factory building, or are some buildings unaffected (for example some you just recently placed)? Does this happen in a fresh world (using sandbox mode)? Does the crash still happen after you pick up and replace your factory building?
Please also provide your save file, or describe a way for me to reproduce this crash from scratch, including which mods you use.