check if localId is defined (prevents silent error due to race conditions on DOMApplicationRegistry.webapps changes)