Share what method you used to deploy Browser (APM or copy/paste):
Which version are you using? (Lite, Pro or SPA):
I have an AngularJS app that sometimes fails to load for a small percentage of our users. In NewRelic this shows as a JS error “angular is not defined” which is triggered during a small inline script at the end of the HTML. The HTML has five script tags in the body referencing external JS libraries. Four of these, including the one containing AngularJS, are hosted on a CDN. None of the script tags have defer or async attributes.
In the available session traces, I see two basic patterns, both reported on Mac Chrome 67, but there are other Chrome versions and Safari versions in which this has occurred:
- CSS from the CDN and JS from the non-CDN library show as having loaded (green bar), but there is no information shown about the CDN JS assets. If the browser failed to load them, e.g. due to local network configuration or conditions, or CDN outage, would that be reflected in the session trace? Is it possible they loaded but did not execute?
- All CSS and JS assets loaded but Angular is still not defined. Is there any other NewRelic information that can help determine why that is happening?
Would calling noticeError from a script.onerror handler provide information about failed asset loads?