The issue: on Safari & iOS webview if we perform a toJSON() on a instanceof Date object which is a 'Invalid Date' object, that throws an error. This does not happen on Firefox & Chrome!
I encountered this issue while sending device contacts over socket.io which iterates over contacts props and does a toJSON(), but the problem was that the Date object from birthday property was not valid.
Simple test case:
An 'Invalid Date' error does not throw anything, so a simple try-catch block doesn't pass the validity of that date.
The changes I made in convertUtils.js resolves this problem.