Silently ignore reference errors when serializing documents.
Revert "Silently ignore reference errors when serializing documents."

This reverts commit 7a0164e55570a15bc54d2cd96bc8509533381ec3.