-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IntersectionObserver is not defined dashboard error when accessing Analytics tab #3278
Comments
This user reports that they're using Mac 10.11.6 OS X El Capitan and Safari version 11.1.2. I tried testing in Safari 11 in BrowserStack and am not able to replicate. Site Health is available. |
We've had another report of this today, troubleshooting ongoing. Added to the list of impacted users in original post. |
Couldn't find out any kind of conflict/error while testing in Safari. |
As per this topic, user is not observing any issues in the incognito window. By checking SH info I can see there is a plugin NitroPack installed that might be the reason. Asking the user to disable the plugin & check again. |
This seems Safari specific, similar to #3255, as confirmed by 2/6 impacted users heighted in the issue description. Awaiting response from impacted users, follow up responses sent and testing to be performed today. From checking the Intersection Observer API Safari doesn't provide full support yet, with many reporting similar issues in Stackoverflow. One user stated that they enabled "prevent cross-site-tracking" within their Safari configuration. |
@jamesozzie Checking in here – should this go over to L2 or are you and @abdullah1908 still working on it? |
@bethanylang Sounds good to me to escalate to L2. Alternatively we can check with the team whether the upcoming changes from #3255 would impact this issue. |
This seems to be related to our use of I found a similar issue on the repo which also indicates that it isn't compatible out-of-the-box with Safari 11: There is a section in the readme about how to add this: I think this is sufficient to move the issue forward with – thanks all! |
@felixarntz we talked about conditionally relying on the intersection observer, but this may be more trouble than it's worth since we can't call hooks conditionally: site-kit-wp/assets/js/modules/pagespeed-insights/components/dashboard/DashboardPageSpeed.js Line 92 in 37e9cad
The library does offer an There is the polyfill as documented on the repo – the cost of adding this to our bundle doesn't look too bad though. What do you think? |
@aaemnnosttv the problem with dynamic import is that webpack uses a static public path which is an empty string and tries to load the imported script from the current virtual directory. In our case, webpack loads dynamically imported scripts using |
@eugene-manuilov ah yes – I believe that's why in the past we had to set the public path on-the-fly before using a dynamic import. The base path should be already available via Site Kit's base data global: |
@aaemnnosttv unfortunately, the public path on the fly doesn't seem to work. Tried it on my local machine and I still see the empty public path string in the generated // runtime.js
...
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
... |
@eugene-manuilov I don't think setting it on the fly would cause it to be updated in the built I've created a quick PR to do this as a proof of concept but I also think it's good to go as-is. In development the added I've updated the IB to use this, let me know what you think. |
It works 🎉! IB ✔️ |
@aaemnnosttv could you please add QAB? |
QA Update:
|
@wpdarren on the current release, if you activate PSI in Safari 11.1 you should see this error On the develop branch, no such error occurs Feel free to try other pages too, but you can test it right on the main dashboard as long as PSI is active. |
QA Update: ✅When on Safari 11.1 and connecting PSI, I was able to recreate the issue on the latest release. When I switched to develop, the error no longer appears when the module is connecting or displaying the insights. While on the branch, I disconnected and connected a few other modules and no error message appeared. |
Bug Description
There have been reports of the below dashboard error, both occurring from Site Kit 1.31.0 users. This seems to occur only when clicking on the Analytics tab for one user while it only occurs on the primary dashboard tab for another.
One user reported that disconnecting Analytics results in no dashboard notice.
Awaiting further insights.
https://wordpress.org/support/topic/cant-find-variable-intersectionobserver/ | Open | Awaiting SH info
https://wordpress.org/support/topic/site-kit-encountered-an-error-32 | Resolved (by user, unknown cause) | SH info filled in although not complete
https://wordpress.org/support/topic/intersectionobserver-is-not-defined/#post-14401649 | Open | awaiting SH info
https://wordpress.org/support/topic/site-kit-encountered-an-error-34/ | Open | Awaiting SH info
https://wordpress.org/support/topic/fatal-error-3876/ | Open | SH info
https://wordpress.org/support/topic/fatal-error-3876/#post-14475607 | Resolved | SH info - Safari specific - MacOS Big Sur, version 11.4.
Additional Context
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
IntersectionObserver
, which is loaded in case it isn't available. See these docs for reference.Implementation Brief
intersection-observer
to our npm dependenciesgooglesitekit-polyfills.js
entryTest Coverage
Visual Regression Changes
QA Brief
Testing Site Kit
Browsers
Changelog entry
The text was updated successfully, but these errors were encountered: