fix(error-boundary): log full error stack for better diagnostics (#10379)

This commit is contained in:
Pavlos Koutoglou authored and GitHub committed 2026-08-13 08:38:18 +00:00
1 parent e09764cd58
commit ffe1d0ae42
2 files changed
+10 -3

No files matched your search

@@ -213,10 +213,14 @@ async function _highlightNunjucksTags(
// TODO: Actually only use dropEffect for this logic. For some reason
// changing it doesn't seem to take affect in Chromium 56 (maybe bug?)
if (droppedInSameEditor) {
// TODO: unsound non-null assertion
const pos = mark.find();
const { from, to } = mark.find()!;
this.replaceRange('', from, to, '+dnd');
if (pos) {
const { from, to } = pos;
this.replaceRange('', from, to, '+dnd');
} else {
console.warn('Tried to remove mark that did not exist', mark);
}
}
// Remove listeners we added
@@ -30,6 +30,9 @@ class SingleErrorBoundary extends PureComponent<Props, State> {
const { children } = this.props;
const firstChild = Array.isArray(children) && children.length === 1 ? children[0] : children;
this.setState({ error, info });
// The fallback below only shows error.message; log the full stack and component
// stack so a crash can actually be diagnosed from the console.
console.error('ErrorBoundary caught an error:', error, info.componentStack);
let componentName = 'component';
try {