Skip to content
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

suppress ResizeObserver error overlay in dev mode #1800

Merged
merged 1 commit into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ const getConfig = async () => {
],
...versions.map(typedocPluginForVersion),
'./plugins/enhanced-codeblock',
'./plugins/suppress-resize-observer-error',
],
};

Expand Down
32 changes: 32 additions & 0 deletions website/plugins/suppress-resize-observer-error/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
This suppresses the 'ResizeObserver loop completed with undelivered notification'
error which can appear when viewing the website in developer mode. This only
prevents the error appearing on the overlay. It will still be visible in the console.
*/
module.exports = function suppressResizeObserverError() {
return {
name: 'suppress-resize-observer-error',
configureWebpack(_config, isServer, _utils) {
if (!isServer) {
return {
devServer: {
client: {
overlay: {
runtimeErrors: error => {
if (
error.message.includes('ResizeObserver') &&
error.message.includes('undelivered notification')
) {
return false;
}
return true;
},
},
},
},
};
}
return {};
},
};
};