I think this error should be put to console.log as well. This function is being called whilst the worker is being loaded, so it is entirely possible we won't have any ports at this stage.