The createPatch() function from the diff library is receiving undefined where it expects a string. One of the values you're passing to it (likely the "original document" content) is undefined — meaning you're probably trying to diff a document before its content is loaded, or an annotation's document field is missing. The plan is to add a check before the function.
