is there any way to edit the world to remove the part of the script which caused this error? I didn't save a backup of the world and I'd really like to get it back.
The original message was a collapsible section which had the error copied and pasted, you can click the little arrow at the beginning of the message to expand it. Also I could not export the world either since I also got the same "RangeError: Invalid string length." error.
I did manage to find the world again in an earlier installation for formamorph that I downloaded incorrectly, so I was able to export the world through there and import it into the new version.