On both Chrome and Safari on mobile when the media query changes sometimes the layout isn't defined yet and the method errors out. It looks like another media query event still fires after the DOM is loaded with the template data so in the end everything is ok. But since I have sentry hooked up, I'm trying to silence errors. The sentry dump is below.
I just simply added a check to make sure the layout is defined before proceeding.
On both Chrome and Safari on mobile when the media query changes sometimes the layout isn't defined yet and the method errors out. It looks like another media query event still fires after the DOM is loaded with the template data so in the end everything is ok. But since I have sentry hooked up, I'm trying to silence errors. The sentry dump is below.
I just simply added a check to make sure the layout is defined before proceeding.