Enhance client-side error handling for missing dependencies
- Dominant language
- JavaScript
- Stars
- 1.4k
- Forks
- 383
- Avg merge
- 4d 14h
- Merged PRs (30d)
- 77
Description
## Feature Description
Site Kit has a number of issues open, some of them quite long-lived which all have similar (but often slightly different) errors:
- #4449
- #4767
- [Related support topics](https://wordpress.org/search/mapselect+intext%3A%22Plugin%3A+Site+Kit+by+Google+-+Analytics%2C+Search+Console%2C+AdSense%2C+Speed%22/)
These almost all are due to problems related to one or more of Site Kit's JS assets which are not loaded due to a number of reasons, but asset optimization plugins are often the cause.
Whatever the reason, the end result for the user is an error boundary component with a rather cryptic error message and stack trace. This is more useful for us to help track down the cause but leaves something to be desired, especially when the problem is fairly simple: something Site Kit depends on isn't there.
Site Kit should be able to perform a series of dependency checks on load, ideally before rendering the main app for a given page. If a dependency is missing, we can render an alternate error state specific for this case and point the user to relevant help/troubleshooting information. This can't handle all possible cases, but it seems worth trying.
Most conflicts happen in Site Kit's admin bar app, due to its presence on the front-end where optimization plugins get aggressive. Accordingly, this would be a good place to start.
Improving this is both a better experience for end users, and will also help improve our signal-to-noise ratio in our error reporting data.
---------------
_Do not alter or remove anything below. The following sections will be managed by moderators only._
## Acceptance criteria
*
## Implementation Brief
*
### Test Coverage
*
## QA Brief
*
## Changelog entry
*
Contributor guide
Assessment
This issue has not been assessed yet.