mirror of
https://github.com/shoelace-style/shoelace.git
synced 2026-01-12 11:09:13 +00:00
Avoid null logs on resize observer errors (#1196)
* Resize observer sometimes throws errors which are nothing to worry about, see also the corresponding comment on tab-group.test.ts * Unfortunately, the web testing library installs an error event handler which takes precedence before the event handlers installed in the tests (see node_modules/@web/browser-logs/dist/logUncaughtErrors.js) * the only possibility to avoid these null logs is to install an error event handler at an even earlier place Co-authored-by: Dominikus Hellgartner <dominikus.hellgartner@gmail.com>
This commit is contained in:
@@ -30,6 +30,11 @@ export default {
|
||||
<body>
|
||||
<link rel="stylesheet" href="dist/themes/light.css">
|
||||
<script type="module" src="dist/shoelace.js"></script>
|
||||
<script>window.addEventListener('error', e => {
|
||||
if(!e.error && e.message && (e.message.includes('ResizeObserver') || e.message === 'Script error.')) {
|
||||
e.stopImmediatePropagation();
|
||||
}
|
||||
});</script>
|
||||
<script type="module" src="${testFramework}"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user